POV (persistance of Vision)
Ray Iddings
Posts: 47
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
·
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
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
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
And dead bug I was going decidedly more low tech
Thanks
Ray
OUTS = %0000000100000001
BTW ... all of this is in the manual and help file (hint, hint).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Thanks,
Ray
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
It is a great book and I strongly suggest it to anyone who is into Stamps.
bugg
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Boe-bot: $229
Toddler: $249
Learning Google is your friend: priceless