0

When I send ,

1

Arduino returns and the 'receive' function output this result,

receive 5 bytes

06 98 78 1E F8

--- (this changes into two outputs like 4bytes, 1 byte or 3 bytes , 2byte as if it is two read from the Arduino board)

My Arduino code is simple ,

void loop(){
//forword();
if(Serial.available() > 0){ //if some date is sent, reads it and saves in state
state = Serial.read();
Serial.print(state);

The data received in hex is different from data sent (in this case - I sent 1). Any idea what the issue is. Thx.

MPV
  • 337
  • 3
  • 10
  • You are thanking before you explained your problem and before asking a question. – blackapps Nov 29 '20 at 22:34
  • @blackapps very important. If you know the code - I'm sending 1 and the hex returned is not 1. Its the problem as in the title. And people like you literally wasting others time by commenting unwanted msgs. – MPV Nov 30 '20 at 23:15
  • Could you add the full code for the Arduino? Thanks! – Axiumin_ Nov 30 '20 at 23:21

1 Answers1

0

OK. Figured out was different from android code.

void setup() {
  
Serial.begin(19200);  //=> changed baud rate from 9600 to 19200 that matches my android code.
delay(500); 
}
MPV
  • 337
  • 3
  • 10