Hello, after a short stop at the intersection, I want to get 1 on the Bluetooth receiver and move to the left and 2 on the right.
How do I code?
my code
if (pixy.line.vectors->m_flags&LINE_FLAG_INTERSECTION_PRESENT)
{
pixy.line.setMode(LINE_MODE_TURN_DELAYED);
}
else // otherwise, pedal to the metal!
{
left += ZUMO_FAST;
right += ZUMO_FAST;
}
}
motors.setLeftSpeed(left);
motors.setRightSpeed(right);
if (res&LINE_INTERSECTION)
{
{pixy.line.setMode(LINE_MODE_TURN_DELAYED);}
if (code == ‘3’) {pixy.line.setNextTurn(45);} // blue 90 degrees is a left turn
else if (code == ‘1’) {pixy.line.setNextTurn(-45);} // red -90 is a right turn
else if (code == ‘2’) {pixy.line.setNextTurn(0); } // green 0 is a stat
}
}
}