Hello one and all.
After some time away for Arduinos, not by choice, I am finally picking it back up. This portion is just a part of a big project. I want to get one part working for I start adding more layers and making it more complicated. Here is my issue. I am trying to send numbers over UART and receive them on the other side. from what I can tell they are being sent just fine it is just the receiving is the problem. I want to receive up to four number examples: 1234, 0785, 2658, 1111, etc. each number will then tell the Ardunio to do something different when. 1-9 seems to work just fine it is when I get into the double digits ie 10+ I start having the problem. The sending unit code is just for testing to watch it change on the other side.
Sending unit code:
int sendingChar = 1;
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
Serial2.begin(9600);
}
void loop() {
Serial1.print(sendingChar);
delay(1000);
sendingChar ++;
}
Receiving unit code:
char received;
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
Serial2.begin(9600);
}
void loop() {
if (Serial1.available()>0){
received = Serial1.read();
}
Serial.println(recieved);
}
any help with this would be great. thank you in advance.