Hardware Reference
In-Depth Information
Figure 3-10. One way of wiring up multiple LEDs to Galileo using a solder-
less breadboard
Now using the functions digitalWrite() and delay() , try modifying the Blink
example and uploading the code to blink the LEDs in different patterns.
Pins 0 and 1 are special digital pins because they're given ad-
ditional functionality: serial communication. You'll get to try
out serial in “Serial Data Output” on page 50 . Be aware that if
you use these pins, they may not behave as expected. For now,
I would suggest avoiding digital pins 0 and 1.
Analog Output
Until now, you've been using digitalWrite() to control the pins. In the realm
of digital, you're working with two possible states: high or low (on or off).
However, not everything in the world is either on or off, and sometimes things
come in a range of values.
For instance, a lamp connected to a regular wall switch is either on or off. But
if it's connected to a dimmer switch ( Figure 3-11 ), it will have a range from
totally off to maximum brightness and all the levels of dim in between. If
digitalWrite() is like an on/off switch, then the next function you'll try, ana
logWrite() , is sort of like a dimmer switch.
 
Search WWH ::




Custom Search