char inChar; // define a variable to store characters received from serial port
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()){ // judge whether data has been received --> Scanning for user input
inChar = Serial.read(); // read the data
Serial.print("received:");
Serial.println(inChar);
}
}