Need help with a PE Labs Fun Book project
turbosupra
Posts: 1,088
Using this project from page 59 of the Pe Labs Fun Book
http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PELabsFunBook-v1.1.pdf
How would I get it to then cycle back from pin 4 to 9 and then start over?
I'd like for it to end up looking like KITT ( )
Thanks for reading
http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PELabsFunBook-v1.1.pdf
'' File: ShiftRightP9toP4.spin '' Demonstrates the right shift operator and if statement. PUB ShiftLedsLeft dira[noparse][[/noparse]9..4] ~~ repeat if outa[noparse][[/noparse]9..4] == 0 outa[noparse][[/noparse]9..4] := %100000 waitcnt(clkfreq/10 + cnt) outa[noparse][[/noparse]9..4] >>= 1
How would I get it to then cycle back from pin 4 to 9 and then start over?
I'd like for it to end up looking like KITT ( )
Thanks for reading
Comments
My first car in 1983 was a 1967 red firebird convertible ... I put KITT lights in the front grill and designed a mechanical rotor to control the lights. Wish I had a Stamp back then to play with.
Kitt lights
Edit... where are my priorities? ... heck, I wish I still had that car!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/7/2009 1:02:41 AM GMT
I couldn't even ride a bike in 83, but having a firebird with kit lights would have been awesome, especially if you did it with a mechanical rotor? Wow!
I loaded your program and it worked, and I would like to ask why you put the number next to the nested repeat commands. Is this so that it had a finite amount of times to add 1, before it executed the next repeat loop? And then it went to the other direction for a finite about of times, and then started over?
Thanks again btw, this made my night! Think it'd be sacrilegious to have KITT lights on a Toyota?
http://www.soundamerica.com/sounds/tvshows/Knight_Rider/KScanr1.wav
*evil laugh*
Propeller WAV players from OBEX
obex.parallax.com/objects/324/
Be careful rigging that up.. Ohio laws (where I live) prohibit use of red or blue lights
in any fashion (except obvious brake/tail lights) as they are used by emergency/police
vehicles. Traveling with KITT lights could get you a ticket here..
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
@Beau:
That's much more elegant code that what I was coming up with, but I thought KITT
had more PWM in the light movement that you used. [noparse];)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
It looks like it says pinL and pinR are set to the sound outputs for the speaker, but which pins are assigned to pinL and pinR?
You are correct about the number next to the nested repeat commands, it simply indicates how many times you want to repeat.
Here is a slight variation of the code that allows you to select any number of contiguous pins and also increase the number of pins
OBC,
"...but I thought KITT had more PWM in the light movement that you used..." - I didn't use no 'stinkin LEDs' - you get that warm PWM effect with incandescent bulbs and a RED filter naturally.
Good point though about putting this on a car now days... back then there was no such law in effect.
Kitt lights
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I figured out how to last night have 15 LED's cycling, I'll compare this code to my code when I get home