// 20160409 Serial test int var_serial_byte; void setup(){ Serial.begin(9600); pinMode(13, OUTPUT); } void blink_led(){ digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); } void led_on(){ digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(5000); // wait 5 seconds digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); } void loop(){ blink_led(); if (Serial.available() > 0) { // check if byte is available led_on(); // turn led 5 seconds on to show Arduino received var_serial_byte = Serial.read(); //read the byte blink_led(); // blink led to show Arduino is reading Serial.println(var_serial_byte); //return the byte led_on(); // turn led 5 seconds on to show Arduino is ready } }