/*
Blink LED with uart / printf
*/
int incomingByte = 0;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial1.begin(115200);
Serial1.println("Press ENTER to start!");
delay(500);
// Wait until a newline character is received
while (incomingByte != '\n') {
if (Serial1.available() > 0) {
incomingByte = Serial1.read();
}
}
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
Serial1.print("LED is: ");
Serial1.println(HIGH);
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
Serial1.print("LED is: ");
Serial1.println(LOW);
delay(1000); // wait for a second
}