Thames & Kosmos Code Gamer Experiment Manual page 31

Coding workshop ? game with kosmobits
Table of Contents

Advertisement

PROJECT 7
Now close the serial monitor. In the main loop, replace the
request
Serial.print("Hello!");
Serial.println("Hello!");
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.
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.
CodeGamer manual inside english.indd 29
with
:
void loop() {
Serial.println("Hello!");
delay(500);
}
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
▲ Unlike with
Serial.print()
CodeGamer
</>
Senden
No line ending
115200 Baud
you always get a new line with the
Serial.println()
output..
29
7/19/16 12:32 PM
!

Advertisement

Table of Contents
loading

Table of Contents