Added notes, photos and code for the first step: driving the displays using basic multiplexing
This commit is contained in:
commit
16a33e26c9
55
NerfStatTrek.ino
Normal file
55
NerfStatTrek.ino
Normal file
@ -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);
|
||||||
|
}
|
BIN
guide/01 - Basic multiplexing test/DSC_0001.jpg
Normal file
BIN
guide/01 - Basic multiplexing test/DSC_0001.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
BIN
guide/01 - Basic multiplexing test/DSC_0009.jpg
Normal file
BIN
guide/01 - Basic multiplexing test/DSC_0009.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 219 KiB |
BIN
guide/01 - Basic multiplexing test/DSC_0010.jpg
Normal file
BIN
guide/01 - Basic multiplexing test/DSC_0010.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 222 KiB |
BIN
guide/01 - Basic multiplexing test/DSC_0011.jpg
Normal file
BIN
guide/01 - Basic multiplexing test/DSC_0011.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
BIN
guide/01 - Basic multiplexing test/Multiplexing.gif
Normal file
BIN
guide/01 - Basic multiplexing test/Multiplexing.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
22
guide/notes.txt
Normal file
22
guide/notes.txt
Normal file
@ -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!
|
13
reference/SMA410363 - 3-digit 7-segment display.txt
Normal file
13
reference/SMA410363 - 3-digit 7-segment display.txt
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user