Shop OBEX P1 Docs P2 Docs Learn Events
POV (persistance of Vision) — Parallax Forums

POV (persistance of Vision)

Ray IddingsRay Iddings Posts: 47
edited 2005-03-24 21:35 in BASIC Stamp
So I was sitting around tonight and I wondered if I could make my BS2 (I guess Rev G) BOE rev C do Persistence of Vision.(move LEDs back and forth fast enough while the LEDs turn on and off makes words appear in air.)·Now first I am not an engineer nor do I play one on TV, I have no idea what is involved in this I just thought I would tinker.

So I hooked up 9 LEDs and 9 470 ohm resistors and a common ground. I used pins IN0-IN8

First I tryed some simple commands to the BOE i.e.:

'·· {$STAMP BS2}
'·· {$PBASIC 2.5}
Main:
· DO
· GOSUB All_Off
· GOSUB All_On
· LOOP
'
[noparse][[/noparse] Subroutines ]
'
All LEDs off
All_Off:
··· LOW 8
····· LOW 7
······· LOW 6
··········· LOW 5
··············· LOW 4
··················· LOW 3
······················· LOW 2
··························· LOW 1
······························· LOW 0

'
All_On
All_On:
· HIGH 8
··· HIGH 7
····· HIGH 6
······· HIGH 5
········· HIGH 4
·············· HIGH 3
··················· HIGH 2
························ HIGH 1
····························· HIGH 0

This blinks them on and off or should I say flickers. I add Pause 500 and turned some on some off you get the idea.

So just from this little experment should I assume that POV needs a Timer, that simple letting the code loop is not enough of a delay? (you know like ON is a drum beat on off on on off.)

I mean the idea is a pendulum swinging back and forth spelling letters and what not. Any thoughts? I mean even if this can't be done without an external time I think I still want to try and write a program that blinks the LED's because then I want an Idea of how to write tighter code, which I assume means to pratice.

Anyway I'm not curing cancer just foolin around any ideas?

Thanks

Ray
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-24 00:34
    You've got subroutines without RETURNs ... that's an issue.· Try this:

    Setup:
    · DIRS = $01FF

    Main:
    · DO
    ··· GOSUB All_On
    ··· GOSUB All_Off
    · LOOP
    · END

    All_On:
    · OUTS = $01FF
    · RETURN

    All_Off:
    · OUTS = $0000
    · RETURN






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • The Dead BugThe Dead Bug Posts: 73
    edited 2005-03-24 01:14
    You can do this with the Basic STAMP. I had a student in class over a year ago use a computer fan as a basis for this. He drilled 6 or 7 holes in line in one of the blades and mounted LEDs in it. He jerry-rigged a mechanical brush system to provide current to the LEDs, used a Hall-effect switch and magnet for timing, and programmed a STAMP to spell his name. It worked well enough for him to get an A in the class.

    I like the idea of using a stepper motor as the basis for the whole system, using a DC motor to drive the stepper as a generator, having the STAMP and all other electronics mounted on the driven stepper, and using the power generated by the driven stepper to run the electronics. No brushes required.
    Bruce

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Name: Bruce Clemens

    Work:· Clemensb@otc.edu
    Good Stuff on my Blog: http://theDeadBug.journalspace.com
  • Ray IddingsRay Iddings Posts: 47
    edited 2005-03-24 01:25
    Thanks Jon now I don't want you to write the whole thing for me. help me get on the right track...obviously using High and Low commands was incorrect. so lets say first sub routine flash All_Off then All_On next lets say I want Just IN8 and IN0 on, instead of using the High/Low commands please explain Outs to me more importantly the strings following Outs = $0000.

    And dead bug I was going decidedly more low tech smile.gif

    Thanks

    Ray
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-24 03:20
    OUTS is a 16 bit regsiter that holds the state of all pins -- a 1 in a bit position will make the output go high IF the corresponding pin has been made an output by setting the same bit in the DIRS regsiters. So, if you want just pins 0 and 8 to be on:

    OUTS = %0000000100000001

    BTW ... all of this is in the manual and help file (hint, hint).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Ray IddingsRay Iddings Posts: 47
    edited 2005-03-24 12:19
    Thanks Jon...BTW For some reason the manual didn't make as much sense as you explination *cough* IM *cough* alittle *cough* slow *cough*cough*

    Thanks,

    Ray
  • Ray IddingsRay Iddings Posts: 47
    edited 2005-03-24 19:44
    So I got the POV working, I can Generate numbers and letters (Thanks Jon). I wired up a breadboard with 9LED's and resistors. I made a wiring harness from my BOE to the breadboard, duct taped the breadboard to a coat hanger and started waving the little blinking LEDs, my kids think I am cool, my wife, well she'll just add this to her "I knew he was insane when...." list.

    Thanks again Jon (much more eligant to us outs than High, Low away we go)and Deadbug. Now how can I make the toliet seat go down on its own....



    Cheers,

    Ray
  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-03-24 20:35
    Chapter 8 of Scott Edwards book "Programming & Customizing the BASIC Stamp Computer" is devoted to entire project on how to create a POV machine using easy to get items.

    It is a great book and I strongly suggest it to anyone who is into Stamps.
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-03-24 21:35
    As for the toilet seat, just use a CR servo geared way down.
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Boe-bot: $229

    Toddler: $249

    Learning Google is your friend: priceless
Sign In or Register to comment.