Can you modulate LEDs with the BS2?
java_programmable
Posts: 7
Hi all, I am trying to make a program in which the speed of the Boe-Bot is determined inversely by the RCTIME function of the photoresistors. I am using the LEDs that come with the Boe-Bot as light sources. I know how to make the LED turn on or off (high PIN/low PIN), but is there a way to go in between for less light? Do I need a lot of LEDs to make this work?
This is the program that I'm running right now. It just turns the LED on and off and outputs the RCTIME.
' {$STAMP BS2}
' {$PBASIC 2.5}
timeleft VAR Word
DO
HIGH 8 'turns on LED
PAUSE 100
HIGH 6 'This sequence gets the RCTIME function
PAUSE 2
RCTIME 6,1,timeleft
DEBUG HOME, "timeleft = ", DEC5 timeleft 'Display RCTIME
PAUSE 500
LOW 8 'turns off LED
PAUSE 100
HIGH 6 'to get the RCTIME function
PAUSE 2
RCTIME 6,1,timeleft
DEBUG HOME, "timeleft = ", DEC5 timeleft 'Display RCTIME
PAUSE 500
LOOP
This is the program that I'm running right now. It just turns the LED on and off and outputs the RCTIME.
' {$STAMP BS2}
' {$PBASIC 2.5}
timeleft VAR Word
DO
HIGH 8 'turns on LED
PAUSE 100
HIGH 6 'This sequence gets the RCTIME function
PAUSE 2
RCTIME 6,1,timeleft
DEBUG HOME, "timeleft = ", DEC5 timeleft 'Display RCTIME
PAUSE 500
LOW 8 'turns off LED
PAUSE 100
HIGH 6 'to get the RCTIME function
PAUSE 2
RCTIME 6,1,timeleft
DEBUG HOME, "timeleft = ", DEC5 timeleft 'Display RCTIME
PAUSE 500
LOOP
Comments
Can somebody please respond to my question? Even if it's a no, it will help me make a decision about what to do for my project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA