commit 16a33e26c93d1a156ac7a5ed3a1864d416d2752b Author: Mark van Renswoude Date: Sat Sep 24 14:12:19 2016 +0200 Added notes, photos and code for the first step: driving the displays using basic multiplexing diff --git a/NerfStatTrek.ino b/NerfStatTrek.ino new file mode 100644 index 0000000..62a6aef --- /dev/null +++ b/NerfStatTrek.ino @@ -0,0 +1,55 @@ +const int PinBottom = 2; +const int PinTop = 5; + +const int PinDigit3 = 3; +const int PinDigit2 = 4; + + +void setup() +{ + pinMode(PinTop, OUTPUT); + pinMode(PinBottom, OUTPUT); + pinMode(PinDigit3, OUTPUT); + pinMode(PinDigit2, OUTPUT); + + digitalWrite(PinTop, LOW); + digitalWrite(PinBottom, LOW); +} + +int lastTime = 0; +bool top = true; + +void loop() +{ + int currentTime = millis(); + if (currentTime - lastTime > 1000) + { + top = !top; + lastTime = currentTime; + } + + // Digit 3 (right) - switch between top and bottom + digitalWrite(PinDigit3, HIGH); + + if (top) + { + digitalWrite(PinTop, HIGH); + delay(1); + digitalWrite(PinTop, LOW); + } + else + { + digitalWrite(PinBottom, HIGH); + delay(1); + digitalWrite(PinBottom, LOW); + } + digitalWrite(PinDigit3, LOW); + + + // Digit 2 (middle) - always bottom + digitalWrite(PinDigit2, HIGH); + digitalWrite(PinBottom, HIGH); + delay(1); + digitalWrite(PinBottom, LOW); + digitalWrite(PinDigit2, LOW); +} diff --git a/guide/01 - Basic multiplexing test/DSC_0001.jpg b/guide/01 - Basic multiplexing test/DSC_0001.jpg new file mode 100644 index 0000000..d29308c Binary files /dev/null and b/guide/01 - Basic multiplexing test/DSC_0001.jpg differ diff --git a/guide/01 - Basic multiplexing test/DSC_0009.jpg b/guide/01 - Basic multiplexing test/DSC_0009.jpg new file mode 100644 index 0000000..f96b1d5 Binary files /dev/null and b/guide/01 - Basic multiplexing test/DSC_0009.jpg differ diff --git a/guide/01 - Basic multiplexing test/DSC_0010.jpg b/guide/01 - Basic multiplexing test/DSC_0010.jpg new file mode 100644 index 0000000..df85f3e Binary files /dev/null and b/guide/01 - Basic multiplexing test/DSC_0010.jpg differ diff --git a/guide/01 - Basic multiplexing test/DSC_0011.jpg b/guide/01 - Basic multiplexing test/DSC_0011.jpg new file mode 100644 index 0000000..f6d61f8 Binary files /dev/null and b/guide/01 - Basic multiplexing test/DSC_0011.jpg differ diff --git a/guide/01 - Basic multiplexing test/Multiplexing.gif b/guide/01 - Basic multiplexing test/Multiplexing.gif new file mode 100644 index 0000000..0f3b744 Binary files /dev/null and b/guide/01 - Basic multiplexing test/Multiplexing.gif differ diff --git a/guide/notes.txt b/guide/notes.txt new file mode 100644 index 0000000..09d5f45 --- /dev/null +++ b/guide/notes.txt @@ -0,0 +1,22 @@ +00 - Planning and getting parts +------------------------------- + +Since most tutorials favored a 9V battery as a power source I opted for this route. +Later I discovered it's about the worst thing you can get and will only power the +Arduino for a day while wasting half the battery's potential. Oh well. For now it'll +do. I decided to get some cheap power switches instead so I can turn it off manually. +This means we definitely need to store the values in EEPROM, neat! + + +01 - Basic multiplexing test +---------------------------- + +Since the 5V regulator, shift registers and DIP transistors weren't in yet I started +off using the regular NPN transistors, powering the Arduino from the USB connection +and the display using two AA batteries. Using 4 transistors will allow switching between +two digits and two segments, to get a feel for how it'll work in the end. + +I didn't want to solder the Arduino just yet but the pins were making aweful connections, +so I lifted it up and stretched the connectors to reach the next row. Similarly, the +batteries are simply stuck together using electrical tape. This whole thing's a bodge at +the moment, but it works! \ No newline at end of file diff --git a/reference/SMA410363 - 3-digit 7-segment display.txt b/reference/SMA410363 - 3-digit 7-segment display.txt new file mode 100644 index 0000000..d5bf3d4 --- /dev/null +++ b/reference/SMA410363 - 3-digit 7-segment display.txt @@ -0,0 +1,13 @@ +Pin Assignment + +1 E (Bottom Left) +2 D (Bottom) +3 Dot +4 C (Bottom Right) +5 G (Middle) +6 B (Top Right) +7 Digit 3 anode (Right) +8 Digit 2 anode (Middle) +9 F (Top Left) +10 A (Top) +11 Digit 1 anode (Left) \ No newline at end of file