Sine Wave for boe bot.
Me and my friends are having a bit of a problem with the Boe-Bot. we are workign on one of the earlier labs where we have to make the boe bot move in the shape of a sine wave. We have spent a large amount of time on thi sand still havent come up with a workable peice of code. WE tried doing half circles, didnt work out well, then we tried just programming different degrees of turn in, and that didnt really work.
Our instructor wants a really nice sine wave taht the boe bot rolls through smoothly. I have tried using subroutines, but am still getting problems.. any help would be appreciated.
Our instructor wants a really nice sine wave taht the boe bot rolls through smoothly. I have tried using subroutines, but am still getting problems.. any help would be appreciated.
Comments
1) Look up SIN in the BASIC Stamp Editor's online help. Read the explanation and try the example programs to get familiar with it.
2) Repeat for the */ command so that you understand how to use it to multiply by values such as 1.5, 3.14, etc.
3) Try the speed ramping activity in Chapter 4, Activity #4 of Robotics with the Boe-Bot v2.2 available for free download from www.parallax.com -> Downloads -> Stamps in Class Tutorials. This demonstrates how to use a FOR...NEXT loop's index variable in the PULSOUT command's Duration argument to give you variable servo speed control. The previous sentence might seem like jargon, but when you try the activity with the speed ramping (and read the explanations) it should start to make more sense.
can it be done with subroutines, that about the most complicated thing i know how to do....
Just reading can tend to bring confusion. If you read, type in the code, run and test it, tinker with it and figure out how it works before moving on to the next topic, it will help.
use a for .. next loop with in creaing values that get added to the pulsout on the servo to sloly increase or decrease its speed. yes.. that i can do.
PULSOUT 13, 800 - index
PULSOUT 12, 700 + (50 - index)
also, my final project for this robotics class is taking the school owned R/c car and attacking a BoE, a sonar unit, and an IR unit to it. In the end it is supposed to wander around campus and search for random Tv's to turn on/ off and change their channels ( hopefully).