tapu
Full Member level 5
Dear All,
I want to send bytes from 0 to 99 from one arduino uno to another arduino nano serially.But when i send 1 then receiver shows 49 on serial monitor,when i send 2 then they shows 50 on reciever .how to manage the code for successfull transmition & reception.i have given both code below.please reply
I want to send bytes from 0 to 99 from one arduino uno to another arduino nano serially.But when i send 1 then receiver shows 49 on serial monitor,when i send 2 then they shows 50 on reciever .how to manage the code for successfull transmition & reception.i have given both code below.please reply
Code:
//Transmitter code
int senddata = 3;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print((int)senddata);
delay(1000);
}
Code:
//Reciever code
int incomingByte=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available())
incomingByte=Serial.read();
Serial.print(incomingByte);
delay(1000);
}