I wrote a program for moving robot. i wrote functions for moving forward, backward, turnig, etc.
everything was working great. but then i added the code for accelerating.
at frist try the robot was accelerating well, but at second try it didn't start moving at all. i removed the code and it still didn't move. it freezd. i had to remove the battery from the brick to turn it back on.
this is the code for moving forward
i found out that if i remove the abs function in
motor[motorB] = abs(speed);
the robot is moving...
i have no idea what is wrong because the first code with abs was working in the beginning. probably is something with robotc.
Thu Apr 17, 2008 6:41 pm
Ford Prefect
Senior Roboticist
Joined: Sat Mar 01, 2008 12:52 pm Posts: 936 Location: a small planet in the vicinity of Beteigeuze
hmmh...
- have you initialized speed before the first call?
- what happens if you wrote
int dummy;
dummy=abs(speed);
motor[motorB] = dummy;
_________________ Ford Prefect
Never purchase release 1.x ! (ancient programmer's wisdom) "Don't argue with idiots. They'll drag you down to their level and then beat you with experience."
Users browsing this forum: No registered users and 11 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum