uart problem can't receive
i trying send decimal number can't receive anything. here code send on 1 arduino:
here receive other arduino:
any more welcome!! know simple problem. oh , have tx on 1 rx on other , vice versa.
code: [select]
// sends "a"s through serial port every second
// 'setup' function
void setup()
{
// start uart @ 9600 bits-per-second (baud)
serial.begin(9600);
}
// main loop
void loop()
{
// print through uart
serial.print(2);
// pause 1 second
delay(1000);
}here receive other arduino:
code: [select]
int incomingbyte = 0; // incoming serial data
void setup() {
serial.begin(9600); // opens serial port, sets data rate 9600 bps
}
void loop() {
// send data when receive data:
if (serial.available() > 0) {
// read incoming byte:
incomingbyte = serial.read();
// got:
serial.print("i received: ");
serial.println(incomingbyte);
}
}
any more welcome!! know simple problem. oh , have tx on 1 rx on other , vice versa.
do have common "ground" connection ?
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > uart problem can't receive
arduino
Comments
Post a Comment