From a8256910d40a0eee85bf539a3f120c9d92485f3f Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 26 Jul 2016 23:50:23 +0200 Subject: o Working version with support for Arduino parts. --- examples/arduino-led/arduino-led.ino | 10 +- examples/arduino-led/schematic.h | 9 ++ examples/arduino-led/schematic/arduino-led.net | 132 +++++++++++++++---------- examples/arduino-led/schematic/arduino-led.sch | 52 +++++++++- 4 files changed, 142 insertions(+), 61 deletions(-) create mode 100644 examples/arduino-led/schematic.h (limited to 'examples') diff --git a/examples/arduino-led/arduino-led.ino b/examples/arduino-led/arduino-led.ino index 01c83ea..9270c7d 100644 --- a/examples/arduino-led/arduino-led.ino +++ b/examples/arduino-led/arduino-led.ino @@ -3,11 +3,13 @@ #include "schematic.h" void setup() { + pinMode(schematic::STATUS_LED, INPUT); } void loop() { - digitalWrite(SCHEMATIC_STATUS_LED, HIGH); - delay(1000); - digitalWrite(SCHEMATIC_STATUS_LED, LOW); - delay(1000); + digitalWrite(schematic::STATUS_LED, HIGH); + delay(1000); + digitalWrite(schematic::STATUS_LED, LOW); + delay(1000); } + diff --git a/examples/arduino-led/schematic.h b/examples/arduino-led/schematic.h new file mode 100644 index 0000000..78ed83c --- /dev/null +++ b/examples/arduino-led/schematic.h @@ -0,0 +1,9 @@ +#ifndef SCHEMATIC_H +#define SCHEMATIC_H + +namespace schematic { +static const int STATUS_LED = 3; +static const int ANALOG_LIGHT_1 = 2; +} // namespace schematic + +#endif // SCHEMATIC_H diff --git a/examples/arduino-led/schematic/arduino-led.net b/examples/arduino-led/schematic/arduino-led.net index f230aaa..54c0ea5 100644 --- a/examples/arduino-led/schematic/arduino-led.net +++ b/examples/arduino-led/schematic/arduino-led.net @@ -1,7 +1,7 @@ (export (version D) (design - (source /home/trygvis/dev/io.trygvis/2016/07/kicad-utils/examples/arduino+led/schematic/arduino+led.sch) - (date "Mon 25 Jul 2016 19:16:49 CEST") + (source /home/trygvis/dev/io.trygvis/2016/07/kicad-utils/examples/arduino-led/schematic/arduino-led.sch) + (date "Tue 26 Jul 2016 21:48:43 CEST") (tool "Eeschema 4.0.2+dfsg1-stable") (sheet (number 1) (name /) (tstamps /) (title_block @@ -9,7 +9,7 @@ (company) (rev) (date) - (source arduino+led.sch) + (source arduino-led.sch) (comment (number 1) (value "")) (comment (number 2) (value "")) (comment (number 3) (value "")) @@ -29,7 +29,17 @@ (value LED) (libsource (lib device) (part LED)) (sheetpath (names /) (tstamps /)) - (tstamp 5791311D))) + (tstamp 5791311D)) + (comp (ref R3) + (value Photores) + (libsource (lib device) (part Photores)) + (sheetpath (names /) (tstamps /)) + (tstamp 5797BF22)) + (comp (ref R2) + (value R) + (libsource (lib device) (part R)) + (sheetpath (names /) (tstamps /)) + (tstamp 5797BFE1))) (libparts (libpart (lib kicad_utils) (part ARDUINO_UNO) (fields @@ -81,6 +91,16 @@ (pins (pin (num 1) (name K) (type passive)) (pin (num 2) (name A) (type passive)))) + (libpart (lib device) (part Photores) + (footprints + (fp R?) + (fp R?-*)) + (fields + (field (name Reference) R) + (field (name Value) Photores)) + (pins + (pin (num 1) (name ~) (type passive)) + (pin (num 2) (name ~) (type passive)))) (libpart (lib device) (part R) (description Resistor) (footprints @@ -93,74 +113,78 @@ (pin (num 1) (name ~) (type passive)) (pin (num 2) (name ~) (type passive))))) (libraries - (library (logical device) - (uri /usr/share/kicad/library/device.lib)) (library (logical kicad_utils) - (uri /home/trygvis/dev/io.trygvis/2016/07/kicad-utils/kicad/kicad_utils.lib))) + (uri /home/trygvis/dev/io.trygvis/2016/07/kicad-utils/kicad/kicad_utils.lib)) + (library (logical device) + (uri /usr/share/kicad/library/device.lib))) (nets - (net (code 1) (name "Net-(U1-Pad25)") - (node (ref U1) (pin 25))) - (net (code 2) (name "Net-(U1-Pad26)") - (node (ref U1) (pin 26))) - (net (code 3) (name "Net-(U1-Pad17)") - (node (ref U1) (pin 17))) - (net (code 4) (name "Net-(U1-Pad27)") - (node (ref U1) (pin 27))) - (net (code 5) (name "Net-(U1-Pad18)") - (node (ref U1) (pin 18))) - (net (code 6) (name "Net-(U1-Pad28)") - (node (ref U1) (pin 28))) - (net (code 7) (name "Net-(U1-Pad19)") + (net (code 1) (name "Net-(U1-Pad19)") (node (ref U1) (pin 19))) - (net (code 8) (name "Net-(U1-Pad29)") + (net (code 2) (name "Net-(U1-Pad29)") (node (ref U1) (pin 29))) - (net (code 9) (name "Net-(U1-Pad15)") - (node (ref U1) (pin 15))) - (net (code 10) (name GND) + (net (code 3) (name GND) + (node (ref R3) (pin 2)) (node (ref D1) (pin 1))) - (net (code 11) (name "Net-(D1-Pad2)") + (net (code 4) (name "Net-(D1-Pad2)") (node (ref D1) (pin 2)) (node (ref R1) (pin 2))) - (net (code 12) (name /STATUS_LED) - (node (ref U1) (pin 16)) - (node (ref R1) (pin 1))) - (net (code 13) (name "Net-(U1-Pad20)") - (node (ref U1) (pin 20))) - (net (code 14) (name "Net-(U1-Pad2)") + (net (code 5) (name /STATUS_LED) + (node (ref R1) (pin 1)) + (node (ref U1) (pin 16))) + (net (code 6) (name "Net-(U1-Pad28)") + (node (ref U1) (pin 28))) + (net (code 7) (name "Net-(R2-Pad1)") + (node (ref U1) (pin 3)) + (node (ref R2) (pin 1))) + (net (code 8) (name /LIGHT_1) + (node (ref U1) (pin 9)) + (node (ref R3) (pin 1)) + (node (ref R2) (pin 2))) + (net (code 9) (name "Net-(U1-Pad12)") + (node (ref U1) (pin 12))) + (net (code 10) (name "Net-(U1-Pad2)") (node (ref U1) (pin 2))) - (net (code 15) (name "Net-(U1-Pad3)") - (node (ref U1) (pin 3))) - (net (code 16) (name "Net-(U1-Pad4)") + (net (code 11) (name "Net-(U1-Pad4)") (node (ref U1) (pin 4))) - (net (code 17) (name "Net-(U1-Pad5)") + (net (code 12) (name "Net-(U1-Pad5)") (node (ref U1) (pin 5))) - (net (code 18) (name "Net-(U1-Pad6)") + (net (code 13) (name "Net-(U1-Pad6)") (node (ref U1) (pin 6))) - (net (code 19) (name "Net-(U1-Pad7)") + (net (code 14) (name "Net-(U1-Pad7)") (node (ref U1) (pin 7))) - (net (code 20) (name "Net-(U1-Pad8)") + (net (code 15) (name "Net-(U1-Pad8)") (node (ref U1) (pin 8))) - (net (code 21) (name "Net-(U1-Pad9)") - (node (ref U1) (pin 9))) - (net (code 22) (name "Net-(U1-Pad10)") + (net (code 16) (name "Net-(U1-Pad10)") (node (ref U1) (pin 10))) - (net (code 23) (name "Net-(U1-Pad1)") - (node (ref U1) (pin 1))) - (net (code 24) (name "Net-(U1-Pad30)") + (net (code 17) (name "Net-(U1-Pad20)") + (node (ref U1) (pin 20))) + (net (code 18) (name "Net-(U1-Pad30)") (node (ref U1) (pin 30))) - (net (code 25) (name "Net-(U1-Pad11)") + (net (code 19) (name "Net-(U1-Pad11)") (node (ref U1) (pin 11))) - (net (code 26) (name "Net-(U1-Pad21)") + (net (code 20) (name "Net-(U1-Pad21)") (node (ref U1) (pin 21))) - (net (code 27) (name "Net-(U1-Pad12)") - (node (ref U1) (pin 12))) - (net (code 28) (name "Net-(U1-Pad22)") + (net (code 21) (name "Net-(U1-Pad1)") + (node (ref U1) (pin 1))) + (net (code 22) (name "Net-(U1-Pad22)") (node (ref U1) (pin 22))) - (net (code 29) (name "Net-(U1-Pad13)") + (net (code 23) (name "Net-(U1-Pad13)") (node (ref U1) (pin 13))) - (net (code 30) (name "Net-(U1-Pad23)") + (net (code 24) (name "Net-(U1-Pad23)") (node (ref U1) (pin 23))) - (net (code 31) (name "Net-(U1-Pad14)") + (net (code 25) (name "Net-(U1-Pad14)") (node (ref U1) (pin 14))) - (net (code 32) (name "Net-(U1-Pad24)") - (node (ref U1) (pin 24))))) \ No newline at end of file + (net (code 26) (name "Net-(U1-Pad24)") + (node (ref U1) (pin 24))) + (net (code 27) (name "Net-(U1-Pad15)") + (node (ref U1) (pin 15))) + (net (code 28) (name "Net-(U1-Pad25)") + (node (ref U1) (pin 25))) + (net (code 29) (name "Net-(U1-Pad26)") + (node (ref U1) (pin 26))) + (net (code 30) (name "Net-(U1-Pad17)") + (node (ref U1) (pin 17))) + (net (code 31) (name "Net-(U1-Pad27)") + (node (ref U1) (pin 27))) + (net (code 32) (name "Net-(U1-Pad18)") + (node (ref U1) (pin 18))))) \ No newline at end of file diff --git a/examples/arduino-led/schematic/arduino-led.sch b/examples/arduino-led/schematic/arduino-led.sch index 642cd4b..e0889f5 100644 --- a/examples/arduino-led/schematic/arduino-led.sch +++ b/examples/arduino-led/schematic/arduino-led.sch @@ -29,7 +29,7 @@ LIBS:atmel LIBS:contrib LIBS:valves LIBS:kicad_utils -LIBS:arduino+mod-lcd3310-cache +LIBS:arduino-led-cache EELAYER 25 0 EELAYER END $Descr A4 11693 8268 @@ -56,10 +56,10 @@ F 3 "" H 5250 3750 60 0000 C CNN 1 0 0 -1 $EndComp $Comp -L GND #PWR1 +L GND #PWR2 U 1 1 579130D3 P 7100 5200 -F 0 "#PWR1" H 7100 4950 50 0001 C CNN +F 0 "#PWR2" H 7100 4950 50 0001 C CNN F 1 "GND" H 7100 5050 50 0000 C CNN F 2 "" H 7100 5200 50 0000 C CNN F 3 "" H 7100 5200 50 0000 C CNN @@ -98,4 +98,50 @@ Wire Wire Line 7100 4950 7100 5200 Text Label 6400 4050 0 60 ~ 0 STATUS_LED +$Comp +L Photores R3 +U 1 1 5797BF22 +P 3950 4700 +F 0 "R3" V 4030 4700 50 0000 C CNN +F 1 "Photores" V 4160 4700 50 0000 C TNN +F 2 "" V 3880 4700 50 0000 C CNN +F 3 "" H 3950 4700 50 0000 C CNN + 1 3950 4700 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR1 +U 1 1 5797BFA3 +P 3950 5150 +F 0 "#PWR1" H 3950 4900 50 0001 C CNN +F 1 "GND" H 3950 5000 50 0000 C CNN +F 2 "" H 3950 5150 50 0000 C CNN +F 3 "" H 3950 5150 50 0000 C CNN + 1 3950 5150 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3950 5150 3950 4950 +Wire Wire Line + 3950 4050 4500 4050 +Wire Wire Line + 3950 3350 4500 3350 +Connection ~ 3950 4050 +$Comp +L R R2 +U 1 1 5797BFE1 +P 3950 3700 +F 0 "R2" V 4030 3700 50 0000 C CNN +F 1 "R" V 3950 3700 50 0000 C CNN +F 2 "" V 3880 3700 50 0000 C CNN +F 3 "" H 3950 3700 50 0000 C CNN + 1 3950 3700 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3950 3550 3950 3350 +Wire Wire Line + 3950 3850 3950 4450 +Text Label 4050 4050 0 60 ~ 0 +LIGHT_1 $EndSCHEMATC -- cgit v1.2.3