PDA

View Full Version : Displaying messages with only 7 (or 4) LEDs on a stick...



flotulopex
- 13th May 2007, 16:43
Hello,

I have trouble in making a stick with leds for displaying message like this example below (this picture is not mine: it was found in internet).
<img src=http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1627&stc=1&d=1179070033">

Instead of 7 LEDs, I have only 4 to display letters; but it should work not too bad...

Currently, I have split one caracter into five sequences (or colons) and light them up for 3ms and then I wait 12ms before I repeat the same letter.

For test purposes, I repeat the same letter 50 times.

Does anyone have some example on how he did?

Thank you.

This is my actual code

' Fuses
@ DEVICE PIC16F690,FCMEN_OFF
@ DEVICE PIC16F690,IESO_OFF
@ DEVICE PIC16F690,BOD_OFF
@ DEVICE PIC16F690,CPD_OFF
@ DEVICE PIC16F690,PROTECT_OFF
@ DEVICE PIC16F690,MCLR_OFF
@ DEVICE PIC16F690,PWRT_OFF
@ DEVICE PIC16F690,WDT_OFF
@ DEVICE PIC16F690,INTRC_OSC_NOCLKOUT

'-------------------------------------------------------------------------------
' Registers
CM1CON0 = %00000000 'Comparator 1 is OFF
CM2CON0 = %00000000 'Comparator 2 is OFF
ANSEL = %00000000 'Disable analog inputs
ANSELH = %00000000 'Disable analog inputs
ADCON0 = %00000000 'ADC is OFF
OPTION_REG = %10000000 'Pull-Ups disabled...
TRISB = %00000000 'All PORTBs are Outputs
PORTB = %00000000 'All PORTBs are Low
WPUB = %00000000 'All Weak Pullups on PORTB are Bisabled

'-------------------------------------------------------------------------------
' Defines

'-------------------------------------------------------------------------------
' Variables
LED4 var PORTB.4
LED5 var PORTB.5
LED6 var PORTB.6
LED7 var PORTB.7
Counter_A var byte
LED_interval var byte
LED_interval = 3
Letter_interval var byte
Letter_interval = 12

'-------------------------------------------------------------------------------
' Program
LOOP:
for counter_a = 0 to 50
gosub letter_A
PORTB = 0
next
pause Letter_interval
for counter_a = 0 to 50
gosub letter_M
PORTB = 0
next
pause Letter_interval
for counter_a = 0 to 50
gosub letter_I
PORTB = 0
next
pause Letter_interval
goto loop

end

'-------------------------------------------------------------------------------
' Message
LETTER_A:
led4 = 0
led5 = 0
led6 = 1
led7 = 1
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 0
pause Led_interval
led4 = 1
led5 = 0
led6 = 1
led7 = 0
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 0
pause Led_interval
led4 = 0
led5 = 0
led6 = 1
led7 = 1
pause Led_interval
return

LETTER_M:
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
led4 = 0
led5 = 1
led6 = 0
led7 = 0
pause Led_interval
led4 = 0
led5 = 0
led6 = 1
led7 = 0
pause Led_interval
led4 = 0
led5 = 1
led6 = 0
led7 = 0
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
return

LETTER_I:
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
led4 = 1
led5 = 1
led6 = 1
led7 = 1
pause Led_interval
return

mister_e
- 13th May 2007, 17:02
From what i feel, you could probably find a tons of example and explanation using 'propeller clock' in google.

Your method seems workable. I never tried something like that so far.

Archangel
- 14th May 2007, 01:56
Hi flotulopex,
Nuts and volts did a project like this which displayed US and Canadian flags on a bike wheel, June 2005 issue. The article was based on kits by infinetix Corp in Spokan, WA. They did not publish any code but did publish flow charts as to how the software worked.
JS

Hi Mister_e,
There some very cool ones out there, yes?
JS

T.Jackson
- 14th May 2007, 04:25
What you're trying to do requires correct speed and timing. A project called Spin FX was published in the Silicon Chip magazine few years back. The article read great! There's still even KITS available for it. (Stock is very limited though)
<a href="http://www.dse.com.au/cgi-bin/dse.storefront/4647d6c8069df9ae2742c0a87f9c074f/Product/View/K3005" target="_blank">Click here to purchase a KIT </a>.

ErnieM
- 14th May 2007, 14:43
How are you getting this code to synchronize with the position of the wand?

Say you wave it right and left over and over. You would want your code to start displaying letters when the wand ‘banks’ to the left side and begins to move to the right, that way as the wand sweeps left to right you draw the pixels of the letters where they are needed in space.

As I read your code there is no synchronization between the drawing and the movement.

To make something simple to try, make the top of the wand a pulled up input and tap it against a grounded post. This gives you a pulse when you’re far left; have the code wait for that pulse THEN (after a short pause) start to draw the pixels ONCE for each letter in turn, then stop and wait for the next synch pulse.

The next trick is to make a cheap acceleration sensor to make this pulse for you from only the change in stick direction.

flotulopex
- 14th May 2007, 17:45
Yup ErnieM,

I was thinking about this "when to start to wave" problem.

This is also why I would have appreciated to get some code examples...

In all website (many thanks to MisterE 'cause I didn't know how to call this type of gadget before his post) where I could find information, there is no mention about a mouvement sensor in the case of handheld models.

My assumption was to repeat the message sequence endlessly and you modulate the wave speed to make it readable.

Or is it not that way it works?

So, if anybody else knows...

skimask
- 14th May 2007, 18:39
Yup ErnieM,
I was thinking about this "when to start to wave" problem.
This is also why I would have appreciated to get some code examples...
In all website (many thanks to MisterE 'cause I didn't know how to call this type of gadget before his post) where I could find information, there is no mention about a mouvement sensor in the case of handheld models.
My assumption was to repeat the message sequence endlessly and you modulate the wave speed to make it readable.
Or is it not that way it works?
So, if anybody else knows...

I suppose it can go both ways...either you trigger it (mercury switch, IR LED, acclerometer, heck, maybe even a neuro-muscular-interface wired into your wrist), or your hand rocks in sync with the program, maybe dial it up or down with a pot or something.

Pic_User
- 14th May 2007, 18:52
I always wanted to make a strip of LEDs that was on a truck body or mounted on an upright pole on a motor vehicle. This single strip of LEDs would be synchronized to the speed of the vehicle. People standing on the side of the road would see the full color “banner” poster, as it swooshed past them!
Or
Maybe, a single pole beside the highway. A single strip of LEDs that could be synchronized to the speed (read by RADAR) of the vehicle. The people moving by would see a full-length bill board, but the “sign” would be a single piece of conduit. No wind loading no blocking the scenery.

Probably not enough speed for the illusion, but a fun “what-if” experiment.....
-Adam-

skimask
- 14th May 2007, 19:16
I always wanted to make a strip of LEDs that was on a truck body or mounted on an upright pole on a motor vehicle. This single strip of LEDs would be synchronized to the speed of the vehicle. People standing on the side of the road would see the full color “banner” poster, as it swooshed past them! Or Maybe, a single pole beside the highway. A single strip of LEDs that could be synchronized to the speed (read by RADAR) of the vehicle. The people moving by would see a full-length bill board, but the “sign” would be a single piece of conduit. No wind loading no blocking the scenery. Probably not enough speed for the illusion, but a fun “what-if” experiment.....
-Adam-

You'd have to focus out in the distance to keep your eyes from tracking the object up close.
Neat idea, and has obvious advantages...but I don't think the average human being operating the average human eye would actually 'LET' it work...unless of course they'd been drinking :D

Pic_User
- 14th May 2007, 19:19
You'd have to focus out in the distance to keep your eyes from tracking the object up close.
Neat idea, and has obvious advantages...but I don't think the average human being operating the average human eye would actually 'LET' it work...unless of course they'd been drinking :D

So we sell beer on the ads!:D

paul borgmeier
- 14th May 2007, 20:06
I always wanted to make a strip of LEDs that was on a truck body or mounted on an upright pole on a motor vehicle. This single strip of LEDs would be synchronized to the speed of the vehicle. People standing on the side of the road would see the full color “banner” poster, as it swooshed past them!
Or
Maybe, a single pole beside the highway. A single strip of LEDs that could be synchronized to the speed (read by RADAR) of the vehicle. The people moving by would see a full-length bill board, but the “sign” would be a single piece of conduit. No wind loading no blocking the scenery.

Probably not enough speed for the illusion, but a fun “what-if” experiment.....
-Adam-

Not to participate (to much) in the hijacking of Flotu's thread, but here is the closest thing I have seen to what Adam describes (I believe someone else pointed this product out a year or ago here on this very forum - I cannot find the reference so here it is again)

http://www.youtube.com/watch?v=IqxldVq3KUA

mister_e
- 15th May 2007, 02:56
OMG... 'kitsch' but interesting at same time.

Toley00
- 16th May 2007, 16:22
Hello Flotulopex,
I did something like that for students school project. I did it very simple with a posicle stick and a little block of wood. I use 7 leds, a PIC16F627A and a CR2032 battery. The trick is to generate an interrupt at the beginning of the movement, for doing it I simply use a bolt soldered on a steel wire. The longuest part is to write character table. I have tu use PORTA cause I needed PORTB for the interrupt pin RB0 and the programming pins also. The bad thing is that RA5 can't be use as an output so I needed to use 5x7 matrix on PORTA without RA5. I splitted each character in 5 parts (lower case, higher case, numbers and french caracters also) and I did a routine that send them as needed. I'm not home at the moment and I don't have any schematic picture or code but I can post some parts of the code if you want.

flotulopex
- 16th May 2007, 18:22
Thanks for all your infos.

I get a better view of what I'll have to do now.

Toley00, thank you for your offer about your code but... for now, I would like to make my own one (I don't like to spoil my fun) ;) If I'm stuck, I'll ask you again.

I was just really missing this info about finding the correct "display start point" for the beginning of the movement...

Ioannis
- 17th May 2007, 09:36
If you don't want to make your own sensor, you might use one of the vibration sensor used in the alarm systems to sense glass breakage. They are adjustable so you can set the sensitivity.

Ioannis

Kamikaze47
- 20th May 2007, 08:35
The trick is to generate an interrupt at the beginning of the movement, for doing it I simply use a bolt soldered on a steel wire.

Toley00: Could you explain how you did this? I'm having trouble visualizing how a bolt soldered on a wire helps. Cheers.