Now close the serial monitor. In the main loop, replace the
request
Serial.print("Hello!");
with
Serial.println("Hello!");
:
void loop() {
Serial.println("Hello!");
delay(500);
}
Load the changed program to the controller and restart
the serial monitor. Each “Hello!” now gets its own line.
Serial.println()
doesn’t just let you output previously
determined messages, though. It can also output newly
determined measurement readings. You will learn about
that in the project “Thermometer,” on page 33.
▲
Unlike with
Serial.print()
you always get a new line with the
Serial.println()
output..
</>
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
115200 Baud
Senden
No line ending
!
NOTE!
If you try to load a program to your KosmoDuino while the serial monitor is open, you may sometimes get an error
message. If that happens, close the serial monitor and try uploading the program again.
29
CodeGamer
PROJECT 7
CodeGamer manual inside english.indd 29
7/19/16 12:32 PM