Quote:
Originally Posted by Nightfall831
today i put the ir board on our robot after some preliminary testing and I have managed to get the robot to respond to the IR signals sent to the IR board.
however, the motors only run for as long as the IR board recieves a signal (less than a second)
our current code looks something like
Code:
if (rc_dig_in01)
{
pwm03 = pwm04 = 1;
pwm07 = pwm08 = 255;
}
i am not surprised at the result i am getting, but all attempts to create constant motion have failed. the only way i can think of is to have the remote cause a variable to be "true" and so that
Code:
while (variable = true)
{
pwm03 = pwm04 = 1;
pwm07 = pwm08 = 255;
}
or something to that effect
any suggestions?
|
You are on the right track. You should start developing routines that do things like 'go forward' and 'go left'. Next, when you get an IR signal you will set a variable that says which routines to run 'forward', 'left', 'stop' , etc. You will probably not be able to control the robot in real-time with the IR inputs.
Instead think if it as sending 'commands' that you will execute until told otherwise. There is going to be a lot of IR scatter and interference so don't expect to get a low latency response from the controller.
John