Hardware Reference
In-Depth Information
Figure 3-15. Set the serial monitor's baud rate to match the baud rate es-
tablished by the Serial.begin() function in your sketch.
To get this to happen, you're using three different serial library functions.
Let's look at each.
Serial.begin()
This is the function that opens the serial port on the Galileo and tells it what
speed to send the data. The number represents bits per second. Because
this is only used once in a sketch, you'll typically call it in the setup function.
Two devices communicating via serial must be using the same
baud rate, even if you're only transmitting data in one direc-
tion. If you have a mismatch between the baud rate of your two
devices, the receiving device may interpret the data it receives
as gibberish.
However, as a side effect of how Galileo handles serial com-
munication between the board and the serial monitor, setting
matching baud rates may not matter. It would be a good idea
to do it anyway so that you're accustomed to doing it and so
that your code will work with other Arduino boards.
Within this topic, I'll be sticking with standard Arduino con-
vention because it will work with Galileo and other Arduino
boards.
 
Search WWH ::




Custom Search