Strobes - Switching patterns?
Nate#2
Posts: 5
Hey there,
I'm trying to make a strobe light, and have succeeded thus far. I'm using the OUTH=% for terminals 8-12 (only 5 LED's available), and I looped it. If I use terminal 0 as an input switch for pattern switch, how should I do it? I can't figure it out for my life.
Code (Had to type it out, it's on another PC):
Something like that. That's basically the pattern.
Thanks for the help
-Nate
Post Edited (Nate#2) : 2/23/2010 3:05:45 AM GMT
I'm trying to make a strobe light, and have succeeded thus far. I'm using the OUTH=% for terminals 8-12 (only 5 LED's available), and I looped it. If I use terminal 0 as an input switch for pattern switch, how should I do it? I can't figure it out for my life.
Code (Had to type it out, it's on another PC):
' {$STAMP BS2} ' {$PBASIC 2.5} DO OUTH= %00000 DIRH= %11111 OUTH= %11000 PAUSE 50 OUTH= %00000 PAUSE 50 OUTH= %11000 PAUSE 50 OUTH= %00000 PAUSE 50 OUTH= %11000 PAUSE 50 OUTH= %00000 PAUSE 30 OUTH= %00011 PAUSE 50 OUTH= %00000 PAUSE 50 OUTH= %00011 PAUSE 50 OUTH= %00000 PAUSE 50 OUTH= %00011 PAUSE 50 OUTH= %00000 PAUSE 50 LOOP
Something like that. That's basically the pattern.
Thanks for the help
-Nate
Post Edited (Nate#2) : 2/23/2010 3:05:45 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
-Nate
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Oh, ok. So, use pin 1? If I do the whole "If in1=1 Then *pattern*", then it tells me to use an "ENDIF" at the end...and I'm not sure what I'd do on it.
Thanks a lot!
-Nate
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
If I use "If in1=1 THEN", it gives me the error of "No ENDIF"...and I don't know how to fix that...or what I'm doing wrong.
Hope that helps. Just PM me if you're still confused, I guess.
-Nate
Check out the syntax and reference manual. It gives you a full explanation of the IF - THEN statements. You can download it from the parallax site. Here is a link:
www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf
Pick_One:
DO
IF IN0 = 1 THEN pattern1
ELSE
IF IN1 = 1 THEN pattern2
ENDIF
ENDIF
LOOP
pattern1:
DEBUG "pattern1"
PAUSE 1000
RETURN
pattern2:
DEBUG "pattern1"
PAUSE 1000
RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam