So let's say, there are some red LED. The LED blink one after another with a gap of, say, 1 second. In this case I will be able to notice a change in the state of the LED, that is whether it is ON or OFF, as shown in the video below:
Now, say I reduce this time gap to about 500 milliseconds. This is what will happen:
If I further reduce the time gap, this is what it will look like:
In the next video the time gap is of the order of micro-seconds.
So, you see, in each of the above cases, I was turning ON only one LED at a time, but as the time delay between turning ON and turning OFF reduced, all the LED seemed to be ON at a time, forming the smiley figure in the last video.
This method is used in all LED displays you might have seen, on the buses, or the railway station..etc.
Instead of the 8x8 LED matrix used above, we could also use a row of LED.
--> For a single row of LED
Look at the diagram below.
t1, t2..t7 have units of time. So, at each t1,t2 etc, the state of the LED will change.
Now, to display a smiley face:
Thus, at time t1, display nothing. Then at t2,t3,t4,t5,t6 display as shown in the picture.
For example, the code for the smiley face will be:
#include<avr/io.h>
#include<util/delay.h>
void main()
{ DDRC=0xff; // making PortC as output port
while(1)
{
PORTC=0x00; // at t1;
_delay_us(10);
PORTC=0b00001000; // at t2 , note that the last row in PC7 and the first row in PC0
_delay_us(10);
PORTC=0b00010010; // at t3
_delay_us(10);
PORTC=0b00010000; // at t4
_delay_us(10);
PORTC=0b00010010; // at t5
_delay_us(10);
PORTC=0b00001000; // at t6
_delay_us(10);
PORTC=0x00; // at t7
_delay_us(10);
}
}
// we can ignore t8 here as it is not required. t7 was included to
//make sure that there was sufficient space between smileys.
Now, all we need to do is move it at a high speed. Since, I couldn't find a cheap enough high rpm motor. I stuck the circuit up on my fan, the result was this :
Circuit board on the fan |
Smile!! |
One more pic:
The characters appear to be reversed because I did not take into account the direction of rotation of the fan.
So, until next time.. Sayōnara!
nice blog
ReplyDeleteThanks! :)
Delete