First of all, sorry for my limited knowledge. I'm quite new to C++ and I'm having trouble connecting the Raspberry Pi to the Koala car using RS232.
The problem I'm facing is that I know everytime I send the command to the car, there will be a random signal sent from the Pi and it will affect my commands. For every first command I send I always get the "Command not found" response from the car.
I'm trying to use the Flush() function to clear off that random signal but it seems to not working :(. Here is my code, please help me :(
_serial = new ClsSerialCom(COM.c_str());
res = _serial->Write("B\r", 2);
if (res == true)
// Read the Acknowledge
res = _serial->Read(data);
//std::cout << data << std::endl;
if (res != true || data != 'b')
cout << data;
// return 1 means successful in opening the serial port