Displaying messages with only 7 (or 4) LEDs on a stick...


Closed Thread
Results 1 to 16 of 16
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Displaying messages with only 7 (or 4) LEDs on a stick...

    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=117907003 3">

    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
    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
    Attached Images Attached Images  
    Roger

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Flags

    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
    Last edited by Archangel; - 14th May 2007 at 01:59.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    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>.

  5. #5
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    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.

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default well then, how does it really work?

    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...
    Roger

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    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.

  8. #8
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Lightbulb synchronized

    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-
    Ohm it's not just a good idea... it's the LAW !

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    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

  10. #10
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Default So we sell beer

    Quote Originally Posted by skimask View Post
    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
    So we sell beer on the ads!

  11. #11
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Pic_User View Post
    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)

    Last edited by paul borgmeier; - 14th May 2007 at 20:11. Reason: sp err
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    OMG... 'kitsch' but interesting at same time.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13
    Join Date
    Jun 2005
    Posts
    29


    Did you find this post helpful? Yes | No

    Default

    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.

  14. #14
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default Cool!

    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...
    Roger

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    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

  16. #16
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Toley00 View Post
    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.

Similar Threads

  1. Code to control 4 LEDs and 2 servos
    By The Master in forum Off Topic
    Replies: 2
    Last Post: - 26th November 2008, 13:33
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 22:19
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. 7 segment digit problem (using Mister E's code)
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2005, 20:25

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts