Int IncomingByte = 0; // For Incoming Serial Data
Void Setup() {
Serial.Begin(9600); // Opens Serial Port, Sets Data Rate To 9600 Bps
}
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.Println(IncomingByte, DEC);
}
} |