|
|
|
@ -0,0 +1,20 @@ |
|
|
|
void setup() { |
|
|
|
// initialize serial communication at 9600 bits per second:
|
|
|
|
Serial.begin(9600); |
|
|
|
} |
|
|
|
|
|
|
|
void loop() { |
|
|
|
// send data only when you receive data:
|
|
|
|
while (Serial.available() > 0) { |
|
|
|
// read the incoming byte:
|
|
|
|
int incomingByte = Serial.read(); |
|
|
|
|
|
|
|
Serial.write(incomingByte); |
|
|
|
} |
|
|
|
|
|
|
|
static int no = 0; |
|
|
|
|
|
|
|
Serial.print("serial port test "); |
|
|
|
Serial.println(no++); |
|
|
|
delay(2000); |
|
|
|
} |