diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-08-05 11:09:53 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-08-05 11:09:53 +0200 |
commit | ff87ea9045a6e0979311ae7b25055d6b53b0a13d (patch) | |
tree | 8f36e478d37caf819919bc02f55816df4a677607 /template/arduino-uno.py | |
parent | bfeeac6e4889d1e9a1083b3c7efc59652981b168 (diff) | |
download | kicad-utils-ff87ea9045a6e0979311ae7b25055d6b53b0a13d.tar.gz kicad-utils-ff87ea9045a6e0979311ae7b25055d6b53b0a13d.tar.bz2 kicad-utils-ff87ea9045a6e0979311ae7b25055d6b53b0a13d.tar.xz kicad-utils-ff87ea9045a6e0979311ae7b25055d6b53b0a13d.zip |
o Dropping the native library code, we're all Python now!
Diffstat (limited to 'template/arduino-uno.py')
-rw-r--r-- | template/arduino-uno.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/template/arduino-uno.py b/template/arduino-uno.py new file mode 100644 index 0000000..0e0e0e1 --- /dev/null +++ b/template/arduino-uno.py @@ -0,0 +1,19 @@ +global generateHeader + +generateHeader.println(""" +namespace schematic { +""") + +usages = generateHeader.netlist.find_usages_of(generateHeader.ref) + +for usage in usages: + node = usage.node_for_ref(generateHeader.ref) + + if 7 <= node.pin <= 12: + generateHeader.println("static const int ANALOG_" + usage.name + " = " + (node.pin - 7) + ";") + elif 13 <= node.pin <= 26: + generateHeader.println("static const int ANALOG_" + usage.name + " = " + (node.pin - 13) + ";") + +generateHeader.println(""" +} // namespace schematic +""") |