Arduino rover with MC33926 motor driver shield powered by UDOO prototyping board. It uses the MC33926 motor driver library.
This sketch is ADK enabled. In the main loop Arduino waits for any commands sent by an Android device. You can find an Android application, ready to deploy, which is fully compatible with this sketch.
With this Arduino sketch you can control two DC motors using a motor driver. This function can be used to send commands to Arduino:
void jeepCommandInterpreter(uint8_t commandMovement, unsigned int commandSpeed);commandMovement defines where the rover should go according to this switch case:
case 0:
Serial.println("Received command: 0 -> move forward");
goForward(vPower);
break;
case 1:
Serial.println("Received command: 1 -> move backward");
goBackward(vPower);
break;
case 2:
Serial.println("Received command: 2 -> turn left");
turnLeft(vPower);
break;
case 3:
Serial.println("Received command: 3 -> turn right");
turnRight(vPower);
break;
case 4:
Serial.println("Received command: 4 -> turn back");
turnBack(vPower);
break;
case 5:
Serial.println("Received command: 5 -> testing all movements");
testAllMovements(vPower);
break;Note: command 5 will test all rover movements.
WARNING: to avoid any damage to your DC motors, be sure to edit defined MAX_POWER.
This variable is used by motorProtection which is executed before launch any commands
to motor driver.
FreeBSD (see LICENSE file)