Quote:
|
Originally Posted by LBK Rules
Our robot will not follow a line of tape. (The banners are calibrated correctly.)
Let me explain our setup:
pwm01 = Left Drive Wheel
pwm02 = Right Drive Wheel
rc_digi_in01 = Left Banner ( WHITE Sig.)
rc_digi_in02 = Right Banner ( WHITE Sig.)
Our Autonomus Code:
PHP Code:
if (rc_dig_in01 == 1 && rc_dig_in02 == 1) { pwm01 = 117; pwm02 = 117; } if (rc_dig_in02 == 1 && rc_dig_in01 < 1) { pwm01 = 117; pwm02 = 113; } if (rc_dig_in02 < 1 && rc_dig_in01 == 1) { pwm01 = 113; pwm02 = 117; } if (rc_dig_in01 < 1 && rc_dig_in02 < 1) { pwm01 = 137; pwm02 = 137; }
Our pwm output is reversed since we are driving the robot backwards in autonomus mode. (The locations I stated above are in autonomus mode.)
The problem is our robot will not do anything if the sensors are not seeing the tape. It just stops.
We are clueless, and any help would be appreciated. (This is the first time I worked with any C[++] programming other than the old "Hello, World!" program.  (If you see any bugs in our code, please respond!  ))
LBK Rules; VB Programmer being suddenly forced to C by FIRST (or IFI, I don't know which). (BTW: I just got back from a meeting about an hour ago.)
|
Couple of problems:
First, when you're going off the line, you correct yourself wrong. If your left sensor goes off the line, you drive the right side harder, meaning you actually go further left. That's an easy mistake to make.
Second, somebody correct me if I'm wrong, the pins are pull ups, meaning that they are normally 1, unless they recieve a signal, which makes them 0. So you need to switch the test for 0s and 1s.
Third, make the power that the motors are driven at a little higher. I'm not sure if your problem was that it wasn't moving, but the way it is now, it will either move really slow or not at all.
P.S. Being a newbie isn't bad. I'm on a newbie team too.
