LED Messaging Waver ( using
persistence of Vision to create letters and words)
The circuit consists of
LEDs tied from the 7 pins of portd to the first 7 pins of portb. The remaining pin (portb.7) can be used to
switch to different messages or change colour….
This pin is connected to
a button with a 10K pull up resister to +5V and a micro switch to GND.
(not shown on this
schematic)
All the LED's are Bi
coloured green and red. There are 7 in
total.
This works best if the
display is spun in a circle or waved left and right....The flashing LEDS when
moved left and right will create the illusion of floating letters in the
air. This is known as persistence of
vision.
When waving the display
right and left the message is displayed forwards then backwards on the back
swing. If rotated clockwise the message
remains correct. With perhaps some timing changes or a mercury switch that
detects forward motion only, the message can be turned off when swinging back…
any takers? I will look into this…..
When waving the display with your hands to
the right the words are displayed correctly as you swing back to the left….the
letters are displayed reverse.
If you are spinning the display in a
circle clockwise the display should read correctly.... have fun with it...
Bring it a rave and wave it around with your personal message....
The led's should be as
close as possible so the words do not appear to "dotty"
The above pictures were
taken with a digital camera in a darkened room.
P.S. Squeezy is my wife….
The included BASCOM-AVR program uses an AT90S2313 Atmel chip program will display two sentences one in
green and one in red. The messages used
in the example program consist of a 7X7 matrix .... but it could really be 7
vertically by anything….because values are calculated vertically.
Please refer to the
table below (matrixletter.gif) for the whole alphabet.
Here is a picture of the
one I built on a perf board. Included
in the zip file are all the images as well as a PC Board layout in Eagle 4.09.
The following 2
BASCOM-AVR programs are used to display the messages on the LEDs. Please note using the above table you can
make it display what ever message you like.
You can even do graphics if you like. I built a similar one using 8 red
LEDs from portb to gnd that allowed me an 8 X 8 matrix for graphic characters
and letters.…The programming is simpler (Listing 2)
Listing 1 – two text
messages two colours.
'I used an ATMEL AT90S2313 20 Pin chip.
'I built it with a 5volt regulator and 4
mhz resonator.
'7 bi-coloured LEDs are attached from
Portd to Portb with a current limiting resister.
'Portd.0 to Portb.0
'portd.1 to Portb.1
'Portd.2 to Portd.2
'Portd.3 to Portd.3
'Portd.4 to Portd.4
'Portd.5 to Portd.5
'Portd.6 to Portd.6
'Portb.7 to pull up resister and momentary
switch to gnd.
'This switch can be used to goto a
subroutine to change colour or between messages....
'currently not using it with this
Application Note.
Dim A As Byte , B1 As Byte , C As Byte
Config Portd = Output
Config Portb = Output
Start:
Portb = 00 'set Portb to all
low to display text in Red.
For C = 1 To 40 '147 bytes to send to
the display, loops 147 times.
Restore Xxx 'displays the message 40 times before
switching to
For A = 1 To 147 'second message.
Read B1 : Portd = B1 'sending text info to portd
Waitms 1
Next
Waitms 1
Next
C = 0
For C = 1 To 40
Portd = 0 'set Portd to all low to display text in Green.
Restore Yyy '2nd message to be
displayed in Green 40 times
For A = 1 To 140 'with 140 bytes of data
to the displays to make up the message.
Read B1 : Portb = B1 ' sending text info to portb
Waitms 1
Next
Waitms 1
Next
Goto Start
End
'Red Message
Xxx:
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H7F , &H01 , &H01 ,
&H01 , &H01 , &H00 , &H00 'l
Data &H3F , &H41 , &H41 ,
&H41 , &H3F , &H00 , &H00 'o
Data &H78 , &H06 , &H01 ,
&H06 , &H78 , &H00 , &H00 'v
Data &H7F , &H49 , &H49 ,
&H41 , &H00 , &H00 , &H00 'e
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H3F , &H40 , &H40 ,
&H3F , &H40 , &H40 , &H3F 'm
Data &H3E , &H01 , &H01 ,
&H01 , &H3E , &H00 , &H00 'u
Data &H7F , &H48 , &H48 ,
&H40 , &H00 , &H00 , &H00 'f
Data &H7F , &H48 , &H48 ,
&H40 , &H00 , &H00 , &H00 'f
Data &H00 , &H00 , &H7F ,
&H00 , &H00 , &H00 , &H00 'i
Data &H7F , &H20 , &H1C ,
&H02 , &H7F , &H00 , &H00 'n
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H3F , &H41 , &H41 ,
&H41 , &H3F , &H00 , &H00 'o
Data &H7F , &H48 , &H48 ,
&H40 , &H00 , &H00 , &H00 'f
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H7F , &H01 , &H01 ,
&H01 , &H01 , &H00 , &H00 'l
Data &H3F , &H41 , &H41 ,
&H41 , &H3F , &H00 , &H00 'o
Data &H78 , &H06 , &H01 ,
&H06 , &H78 , &H00 , &H00 'v
Data &H7F , &H49 , &H49 ,
&H41 , &H00 , &H00 , &H00 'e
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
'Green Message
Yyy:
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H00 , &H00 , &H7F ,
&H00 , &H00 , &H00 , &H00 'i
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00 '
Data &H7F , &H01 , &H01 ,
&H01 , &H01 , &H00 , &H00
'l
Data &H3F , &H41 , &H41 ,
&H41 , &H3F , &H00 , &H00 'o
Data &H78 , &H06 , &H01 ,
&H06 , &H78 , &H00 , &H00 'v
Data &H7F , &H49 , &H49 ,
&H41 , &H00 , &H00 , &H00 'e
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H40 , &H20 , &H1F ,
&H20 , &H40 , &H00 , &H00 'y
Data &H3F , &H41 , &H41 ,
&H41 , &H3F , &H00 , &H00 'o
Data &H3E , &H01 , &H01 ,
&H01 , &H3E , &H00 , &H00 'u
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Data &H32 , &H49 , &H49 ,
&H49 , &H26 , &H00 , &H00 's
Data &H3E , &H41 , &H45 ,
&H43 , &H3F , &H00 , &H00 'q
Data &H3E , &H01 , &H01 ,
&H01 , &H3E , &H00 , &H00 'u
Data &H7F , &H49 , &H49 ,
&H41 , &H00 , &H00 , &H00 'e
Data &H7F , &H49 , &H49 ,
&H41 , &H00 , &H00 , &H00 'e
Data &H43 , &H45 , &H49 ,
&H51 , &H61 , &H00 , &H00 'z
Data &H40 , &H20 , &H1F ,
&H20 , &H40 , &H00 , &H00 'y
Data &H00 , &H00 , &H00 ,
&H00 , &H00 , &H00 , &H00
Listing 1 – two text
messages single colour.
'
I used an ATMEL AT90S2313 20 Pin chip.
'
and built it with a 5volt regulator and 4 mhz resonator.
'8
superbright red LEDs are attached from Portb to Gnd through a current limiting
resister.
'Portd.2
to pull up resister and momentary switch to gnd.
'This
switch can be used to goto a subroutine to change between messages....
'currently
not using it with this Application Note.
Dim
A As Byte , B1 As Byte , C As Integer
Config
Portb = Output
Wait
2
Start:
Portb
= 00
For
C = 1 To 100
Restore
Xxx 'gets data from the XXX
table.
For
A = 1 To 32 'there are 32 bytes of
data so it loops 32 times
Read B1 : Portb = B1 'values
from the table are output to the LEDs.
Waitus
400 'determines the
width of each letter
Next 'the first
message is I love U with a heart shape
Waitms
1 ‘for the word
love.
Next
C
= 0
For
C = 1 To 100
Portb
= 00
Restore
Yyy
For
A = 1 To 119
Read B1 : Portb = B1
Waitus
400 'determines the
width of each letter
Next '119 bytes of data to display the
message here
Waitms
1 'so the loops
goes for 119 times.
Next
Goto
Start
End
Xxx:
Data
&H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 ,
&H00
Data
&H81 , &HFF , &H81 , &H00 , &H00 , &H00 , &H30 ,
&H48
Data
&H84 , &H82 , &H41 , &H82 , &H84 , &H48 , &H30 ,
&H00
Data
&H00 , &H00 , &HFE , &H01 , &H01 , &H01 , &HFE ,
&H00
Data
&H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 ,
&H00
Yyy:
Data
&H00 , &H00 , &H7F , &H00 , &H00 , &H00 , &H00 'i
Data
&H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00 '
Data
&H7F , &H01 , &H01 , &H01 , &H01 , &H00 , &H00 'l
Data
&H3F , &H41 , &H41 , &H41 , &H3F , &H00 , &H00 'o
Data
&H78 , &H06 , &H01 , &H06 , &H78 , &H00 , &H00 'v
Data
&H7F , &H49 , &H49 , &H41 , &H00 , &H00 , &H00 'e
Data
&H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00
Data
&H40 , &H20 , &H1F , &H20 , &H40 , &H00 , &H00 'y
Data
&H3F , &H41 , &H41 , &H41 , &H3F , &H00 , &H00 'o
Data
&H3E , &H01 , &H01 , &H01 , &H3E , &H00 , &H00 'u
Data
&H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00
Data
&H00 , &H02 , &H01 , &H01 , &H7E , &H00 , &H00 'J
Data
&H3E , &H01 , &H01 , &H01 , &H3E , &H00 , &H00 'u
Data
&H7F , &H01 , &H01 , &H01 , &H01 , &H00 , &H00 'l
Data
&H00 , &H00 , &H7F , &H00 , &H00 , &H00 , &H00 'i
Data
&H7F , &H49 , &H49 , &H41 , &H00 , &H00 , &H00 'e
Data
&H00 , &H00 , &H00 , &H00 , &H00 , &H00 , &H00
For
comments or more information you can contact me on the Bascom-AVR mail list.
I
hope you enjoy this fun project.
:
)