int incomingByte = 0; // for incoming serial data
void setup()
{
// start serial port at 9600 bps:
Serial.begin(4800);
}
void loop()
{
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
// say what you got:
//Serial.print("I received: ");
Serial.print(byte(incomingByte));
}
}
Comments