Hardware Reference
In-Depth Information
For example, a simple stopwatch has inputs and outputs. The start button
would be considered an input. When you press the start button, it triggers a
timer that keeps track of the time and outputs that information to the display
on the face of the watch.
A digital voice recorder has a microphone for sound input, and a small speak-
er for sound output. Like the stopwatch, it also has input buttons to start or
stop the recorder and a small display to output the amount of time that's left
to record before you fill up the device's memory.
Code
Of course, it's not as simple as just wiring up inputs and outputs to a Galileo.
You have to tell the board how you want it to respond to the inputs and how
you want it to control the outputs. By programming the board, you'll be able
to tell it what you want it to do.
For instance, a simple thermostat project will periodically check the value
from a temperature sensor and compare it to the desired temperature that
the user set using a dial control. If the temperature that the sensor measures
is lower than the desired temperature, the board will activate a heater until
the temperature gets close enough to the desired temperature. Logic like this
will be defined by the code you write.
The Galileo can be programmed and reprogrammed over and over again. In
fact, in the course of developing a project, you'll likely go through a cycle of
writing code, uploading it to the board, checking how it works, finding prob-
lems, making adjustments to your code, and then uploading it again.
You may even find yourself using the board for one project, and then pulling
the board out, reprogramming it, and using it for a completely different
project a few weeks later.
Communication
The Galileo can also communicate with other devices in a few different ways.
You can have it connect to your computer via USB to send and receive data.
You might have Galileo send information about what it's doing to a console
window running on your computer so that you can figure out why something
isn't working right (this is known as debugging ). Or you can have it send in-
formation about sensors to the computer so that it can display a live graph.
Galileo can also connect to other devices over the Internet using its built-in
Ethernet ( Figure 1-3 ) or an optional WiFi module. It can receive information
about the weather or your email. It can search Twitter and much more. It can
also use the Internet connection to send information such as temperature
sensor data, the images from a webcam, or the state of your dog's water
bowl.
Search WWH ::




Custom Search