Need help again.
If this is not the right fourm please provide the best fourm to use.
I am new to Basic Stamp and have been playing with·a Boe Bot.
I can get it to move forward and back and turn. I can also get an LED to flash.
Now what I want·is to·start the led flashing·at the·begining of·movement commands and then stop it at the end of all the movement commands.
I have read about if statements do - loop statements but I don't think that is where I need to be.
Any help would be great.
·Cheers Mark
I am new to Basic Stamp and have been playing with·a Boe Bot.
I can get it to move forward and back and turn. I can also get an LED to flash.
Now what I want·is to·start the led flashing·at the·begining of·movement commands and then stop it at the end of all the movement commands.
I have read about if statements do - loop statements but I don't think that is where I need to be.
Any help would be great.
·Cheers Mark
Comments
Basically, servos need a pulse about every 20ms and the width of the pulse (0.5-2.5ms max) controls the direction and speed or the position of the servo. Typically, a Stamp program sits in a loop and every (roughly) 20ms, it puts out a pulse for each servo, reads its sensors, and decides how it's going to move on the next 20ms cycle. You could add a little bit of code to each cycle that decides whether the LED needs to be on or off for that cycle (maybe stays on for 10-20 cycles, then off for 10-20 cycles to give a blink rate of 1/2 to 1 second). You'll need a counter that gets incremented on each cycle and a subroutine to do the bookkeeping.
Sounds possible but not at this point for me. (my level).
Now that I know it is a single thread I see things a bit differantly, and thats ok. Lots to learn and having fun.
Do you know of any online training classes to help with programing or am I better to just keep creating challanges and try to solve them.
Thanks for the help and I am sure we will talk again.
Mark
There aren't any on-line courses that I've heard of, but there's a tremendous amount of educational material on the Stamps available, mostly from Parallax for free in downloadable form (and inexpensively in paper form).
Also check out Tracy Allen's website: www.emesystems.com.