Here's my take on the "air writer" POV display.
I decided to go minimal, so all you need is:
- 1x ATTiny85 processor chip
- Coin cell battery
- 5x leds
- 1x resistor
I wanted the compnent count to be as low as possible, so I went with a single resistor, shared by all the LEDs.
Technically this means they may not be as bright if all are lit up simultaneously, but I didn't find that to be much of an issue in practice
The good ol' ATTiny85 can run without any external crystal etc, so suited this minimalism greatly.
Circuit:
Here's a look at my dodgy soldering, I also used the legs of the LEDs as link wires...
Now down to coding:
To draw a letter 'A'
16 * LED1
8 * LED2
4 * * LED3
2 * * * LED4
1 * * LED5
1 6 26 6 1
Add the numbers on the left column for each lit LED, to convert it into decimal:
int a[] = {1, 6, 26, 6, 1};
(this is effectively converting binary to decimal)
The following code will then light up each column above in turn on the stack of 5 LEDs:
for (int i = 0; i <5; i++)
displayLine(a[i]);
delay(2);
displayLine is a function to convert those deimal numbers into binary:
e.g. "26" into display LEDs 1,2 and 4 ( 26 = 16 + 8 + 2):
void displayLine(int line){
int myline;myline = line;
if (myline>=16) {digitalWrite(LED1, HIGH); myline-=16;}
if (myline>=8) {digitalWrite(LED2, HIGH); myline-=8;}
if (myline>=4) {digitalWrite(LED3, HIGH); myline-=4;}
if (myline>=2) {digitalWrite(LED4, HIGH); myline-=2;}
if (myline>=1) {digitalWrite(LED5, HIGH); myline-=1;}
Here's a video of it running:
https://www.youtube.com/watch?v=9IbCPn6nkfA&feature=youtu.be
All code up on github:
https://github.com/mikerr/ArduinoPOV
https://www.youtube.com/watch?v=9IbCPn6nkfA