Bot Bluetooth Using Remotexy
Bot Bluetooth Using Remotexy
} RemoteXY;
void setup()
{
//defining the motor pins as the output pins
pinMode (IN1, OUTPUT);
pinMode (IN2, OUTPUT);
pinMode (IN3, OUTPUT);
pinMode (IN4, OUTPUT);
pinMode (ledpin, OUTPUT);
RemoteXY_Init ();
}
void loop()
{
RemoteXY_Handler ();
digitalWrite (ledpin, (RemoteXY.switch_1==0)?LOW:HIGH);
Speed (first_motor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x);
Speed (second_motor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x);
}