// RXD no pino 2 e TXD no pino 3
SoftwareSerial bluetooth(2, 3); // RX, TX
void setup() {
Serial.begin(9600);
while (!Serial) {
// Esperando a comunicação Bluetooth
}
pinMode(motor_dir_F, OUTPUT);
pinMode(motor_dir_T, OUTPUT);
pinMode(motor_esq_F, OUTPUT);
pinMode(motor_esq_T, OUTPUT);
bluetooth.begin(9600);
}
void loop() {
if (bluetooth.available()) {
char dadoBluetooth = bluetooth.read();
Serial.println(dadoBluetooth);
// Código vai aqui
}
}