Bstamp new student
student1
Posts: 3
· I am trying to write a simple program that will turn 3 different leds on and off at different times. the program should make the red led come on, flash a green led 5 times at 1 second intervals,flash a yellow led 10 times at .3 second intervalsand then turn off red led.
· i have the stamp working and am able to wink the leds but i can not figure out how to get them to function at··rates at the same time.
· please help
·
· i have the stamp working and am able to wink the leds but i can not figure out how to get them to function at··rates at the same time.
· please help
·
Comments
Also do you have the LEDs connected through current limiting resistors?
counter VAR byte
turn red led on
While counter < 50
if counter % 10 then toggle green led
if counter % 3 and counter < 30 toggle yellow
LOOP
turn all leds off
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
develop a flowchart that shows the following pseudo-code.
1)start
2)turn on the red LED
3)flash the green LEDs 5 times at 1 second intervals.
4)FLash the Yellow LED 10 times at 0.3 second intervals.
5)turn off the red LED
6)stop
write the program to perform these functions
I do not need help with the flow chart, but I don't have a clue how to write this program.
HELP!!!
a) How to turn an LED on/off
b) How to keep time on the stamp
For a), might I suggest that you look up the commands HIGH, LOW, and TOGGLE
for b), take a look at PAUSE.
You can look in the Basic Stamp Syntax and Reference Manual for specific commands, and take a look at What's a Microcontroller for general programming information, including information on how to work with LEDs.
BTW, posting homework the night before it is due is almost a double sin...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
BWIN ON DA POWAH WIFIN U!!!