I am trying to control NXT robot using Arduino UNO and bluetooth, I used this code
#include <SoftwareSerial.h>
byte moveTelegram [] = {0x0C,0x00,0x80,0x04,0x01,0x32,0x05,0x01,0x00,0x20,0x00,0x00,0x00,0x00};
SoftwareSerial blue(10, 11);
int BluetoothData;
void setup()
{
blue.begin(9600);
}
void loop()
{
blue.write(moveTelegram,sizeof(moveTelegram));
delay(100);
BluetoothData=blue.read();
delay(2000);
}
My problem is , I have to send data from NXT to Arduino, and then the NXT start moving (if I add blue.read() to my code).
How to make the NXT execute the commands directly?
Thanks,