Hardware Reference
In-Depth Information
Discussion
The GPS outputs text every second or so. The Bone's serial port is set up to call the
onSerial
function whenever text is ready. When
onSerial
sees a
data
event, it con-
verts the data to a string and prints it. The second
console.log()
takes the raw data
and passes it through the
nmea
parser, which converts it to a more readable form and then
prints it.
NOTE
You cannot use every pin as a UART. Point your browser to
the Headers page served by your
Bone
(or
Online headers-serial page
)
and scroll down to the UART page to see which pins
work. The table is reproduced in
Figure 2-17
.