*/ (comments), 33
/* (comments), 33
3G, 274
4G, 275
A
abs( ) function, 73
AC (alternating current), 46
voltage and, 47
Adafruit Si1145 library, 384–388
ADC (Analog to Digital Converter), 67–68, 295
addresses
IP addresses, 153
MAC address, 153
retrieving, 176
ad-hoc mode for wireless, 171
analogRead( ) function, 68
analogWrite( ) function, 68
analog systems, 5
analogRead( ) function, 68, 353
analogWrite( ) function, 59–60, 68
archives versus installers, 27
Arduino
counterfeits, 9
fetching example program, 161–162
sending/receiving data, 158–161
sketch example program, 165–167
open source, 20
as Open Source Hardware project, 7
original, 9
Arduino board, original, 7
Arduino Esplora, 18
TFT, 229
Arduino Ethernet, 11
Arduino Ethernet Shield, 21
Arduino GSM Shield, 22
Arduino language, I/O functions, digital I/O, 65–67
Arduino Micro, 13
Arduino Mini, 13
Arduino Motor Shield, 21
Arduino Playground, 29
Arduino Pro, 16
Arduino Tre, 19
Arduino Uno, 10
voltage regulator, 47
Arduino WiFi Shield, 22
Arduino Wireless SD Shield, 21
Arduino Zero, 19
ARM technology, 6
array data type, 37
ASCII, keyboards, 324
ATmega series, 8
Atmel (Advanced Technology for Memory and Logic), 5
megaAVR, 8
microcontrollers for Arduino, 7
Atmel 8-bit AVR, 7
attached( ) function, 245
attachGPRS( ) function, 283
attachInterrupt( ) function, 77–78
audio, 292
ADC (Analog to Digital Converter), 295
DAC (Digital to Analog Converters), 294, 295
digital
creating, 296
storage, 296
effective sampling rate, 293
frequencies, 293
audio tones
noTone( ) function, 69
tone( ) function, 69
autoscroll( ) function, 198
B
BASIC Stamp, 7
begin( ) function, 91, 94, 155, 174–175
beginSpeaker( ) function, 356–357
bipolar stepper motors, 255–256
bits
reading, EEPROM library, 105–107
writing, EEPROM library, 105–107
blink( ) function, 197
Blum, Jeremy, Exploring Arduino, 26
boolean data type, 36
bootloaders, 33
connection points, 57
Fritzing, 396
solderless, 57
strips, 57
break statement, 40
breakdown voltage, 54
YunClient, 368
bus speed, I2C protocol, 147–148
buttons, Esplora library, 339–340
buzzer, Esplora library, 340–341
byte data type, 37
bytes
reading, 92
writing, EEPROM library, 104–105
cabling, Ethernet, 151
callbacks, 141
decoupling, 54
farad, 54
CD drives, 209
channels, Wi-Fi, 172
char data type, 36
circuits (electrical), 46
classes
SoftwareSerial, 99
clear( ) function, 196
clearScreen( ) function, 355
closed source libraries, 417–418
CodeBlocks, 29
color, TFT library, 232
config( ) function, 178
connection points, breadboards, 57
connectServer( ) function, 86
constrain( ) function, 73
constructors, 411
control board (Robot library)
robot personalization, 353–354
cooperative multitasking, 309–311
cos( ) function, 76
CPOL (Clock Polarity), 123
createChar( ) function, 199
Creative Commons Attribution Share-Alike license, 29
CRT (cathode ray tubes), 226–227
cruise ship analogy for analog I/O, 67
CS (Chip Select), 118
cursor, LiquidCrystal library, 196–197
D
DAC (Digital to Analog Converters), 294, 295
data
reading
begin( ) function, 94
end( ) function, 94
peek( ) function, 93
starting communications, 91
sending, 90
data bits, 85
data encapsulation, 85
data types
array, 37
boolean, 36
byte, 37
char, 36
double, 37
float, 37
int, 37
long, 37
short, 37
String, 37
string, 37
unsigned char, 36
unsigned int, 37
unsigned long, 37
void, 36
word, 37
DC (direct current), 46
voltage and, 47
debugPrint( ) function, 355
declaring variables, 34
decoupling capacitors, 54
delay function, 35
delayMicroseconds( ) function, 71
detach( ) function, 245
detachInterrupt( ) function, 78
DHCP leases, renewing, 156–157
digital audio
creating, 296
storing, 296
digital I/O
digitalRead( ) function, 66–67
digitalWrite( ) function, 67
INPUT pins, 66
INPUT_PULLUP pins, 66
OUTPUT pins, 66
pinMode( ) function, 66
voltage and, 65
digitalRead( ) function, 66–67, 353
digitalWrite( ) function, 67, 308, 353
laser, 55
LEDs (light-emitting diodes), 55–56
Schottky diodes, 55
Tunnel diodes, 55
DIP (Dual In-Line Package) chips, 57
disconnect( ) function, 177–178
displayLogos( ) function, 355
DMA (Direct Memory Access), 5
DNS (Domain Name Service), 153
double data type, 37
downloads, Arduino software, 27–28
DRAM (Dynamic RAM), 102
drawBMP( ) function, 355
drawCompass( ) function, 355
Dual Scan (DSTN), 227
E
Eclipse, 29
EDGE (Enhanced Data rates for GSM Evolution), 274
editor, 28
EEPROM (Electronically Erasable Programmable Read-Only Memory), 5, 103
library, 104
values, reading/writing, 108–110
nonvolatile memory, 114
effective sampling rate, audio, 293
EIA (Electronic Industries Association), 50
electricity, 46
circuits, 46
Ohm's law, 49
electronic components, 23, 49–50
resistors
tolerance, 47
transistors, 56
electricity and, 46
embedded systems, debugging and, 86–87
encapsulation, 85
encryption
types, 177
WEP, 173
WPA2, 173
end( ) function, 94
EPROM (Electrically Programmable Read Only Memory), 102
chip reprogramming, 102
Esplora library
LCD module, 342
Ethernet
fetching example program, 161–162
sending/receiving data, 158–161
sketch example program, 165–167
cables, 151
library
PoE, 152
EthernetClient object, 157–158
examples, libraries, 415
Exploring Arduino (Blum), 26
F
farad, 54
FAT (File Allocation Table), 213
fetching, example program, 161–162
files
SD library
source files, 25
filesystem, SD cards, 212
Firmata, 262
Firmata library, 262
messages
sending, 263
Firmata protocol
Arduinos and, 103
float data type, 37
for loop, 41
frequencies, audio, 293
Fritzing, 22
breadboards, 396
abs( ), 73
attached( ), 245
attachGPRS( ), 283
autoscroll( ), 198
begin( ), 91, 94, 155, 174–175
blink( ), 197
clear( ), 196
clearScreen( ), 355
config( ), 178
connectServer( ), 86
constrain( ), 73
cos( ), 76
createChar( ), 199
debugPrint( ), 355
delay, 35
delayMicroseconds( ), 71
detach( ), 245
detachInterrupt( ), 78
displayLogos( ), 355
drawBMP( ), 355
drawCompass( ), 355
end( ), 94
getKey( ), 328
getTimeStamp( ), 372
getVoiceCallStatus( ), 281–282
hangCall( ), 282
interrupts( ), 78
isDirectory( ), 219
keyboardRead( ), 352
millis( ), 71
min( ), 72
motorsStop( ), 351
noAutoscroll( ), 198
noBlink( ), 197
noCursor( ), 197
noInterrupts( ), 78
parameters, 34
parseFloat( ), 94
parseInt( ), 94
peek( ), 93
pointTo( ), 351
pow( ), 74
println, 90
println( ), 158
processInput( ), 264
pulseIn( ), 70
readAccelerometer( ), 339
readButton( ), 340
readIR( ), 383
readProx( ), 383
readUV( ), 383
readVisible( ), 383
receiveData( ), 144
RSSI( ), 177
sendAnalog( ), 263
sendData( ), 144
sendDigitalPort( ), 263
setBitOrder( ), 122
setDataMode( ), 122
setup( ), 35
sin( ), 76
sqrt( ), 74
SSID( ), 177
stop( ), 158
stringCallback( ), 265
tan( ), 76
updateIR( ), 352
userNameWrite( ), 354
Wire.available( ), 142
Wire.beginTransmission( ), 146
Wire.endTransmission( ), 146
Wire.onRequest( ), 142
Wire.read( ), 142
Wire.requestFrom( ), 146
write( ), 90, 104–105, 196, 199, 218
WriteBlue( ), 338
WriteGreen( ), 338
WriteRed( ), 338
G
getKey( ) function, 328
getModifiers( ) function, 328–329
getTimeStamp( ) function, 372
getVoiceCallStatus( ) function, 281–282
getXChange( ) function, 329–330
getYChange( ) function, 329–330
GitHub, 379
GPRS (General Packet Radio Service), 274, 282–284
graphics, TFT library, 231–233
GSM, 272
Arduino and, 276
EDGE, 274
GPRS, 274
modem class, 284
H
.h files, 406
hangCall( ) function, 282
hardware
LED connections, 60
LiquidCrystal library, 200–201
stepper motors, 255
TFT library example, 234
header files, libraries, 406–407
hot pluggable devices, 323
USB, 325
I
I2C pins, 137
shields, 148
voltage, 147
IDE (Integrated Development Environment), 8, 25
format organization, 381
installation, 26
software, 28
IEEE (Institute of Electrical and Electronics Engineers), 171
importing libraries, 379–381, 408–409
infrastructure mode, 172
INPUT pins, 66
INPUT_PULLUP pins, 66
installation, IDE, 26
installers versus archives, 27
int data type, 37
int keyword, 34
attachInterrupt( ) function, 77–78
detachInterrupt( ), 78
interrupts( ) function, 78
noInterrupts( ) function, 78
interrupts( ) function, 78
I/O functions
analogRead( ) function, 68
analogWrite( ) function, 68
audio tones, 69
digital I/O
digitalRead( ) function, 66–67
digitalWrite( ) function, 67
INPUT pins, 66
INPUT_PULLUP pins, 66
OUTPUT pins, 66
pinMode( ) function, 66
voltage and, 65
IP addresses, 153
ISA cards, 4
isDirectory( ) function, 219
ISR (Interrupt Service Routine), 77
K
Kdevelop, 29
keyboardRead( ) function, 352
keyboards
return codes, 352
keywords
int, 34
void, 34
L
laser diodes, 55
LCD (liquid crystal display), 192–194, 227
Esplora, 337
LCD module, Esplora library, 342
LCD screen, Robot library, 354–356
LEDs (light-emitting diodes), 23, 55–56
connecting
hardware, 60
advantages, 378
distributing, 417
function calls, 406
GitHub, 379
.h files, 406
Servo, 244
sketches and, 378
TFT, 228
third-party, 377
liquid crystal display. See LCD (liquid crystal display)
LiquidCrystal library
importing, 194
text
orientation, 197
LiquidCrystal object, 194
Logo programming language, 347
long data type, 37
loop( ) function, 35, 130, 164
loops
for, 41
while, 41
M
MAC address, 153
begin( ) function, 155
retrieving, 176
master communication, I2C protocol, 139–141
mathematical functions
abs( ), 73
constrain( ) function, 73
min( ), 72
pow( ), 274
sqrt( ), 74
memory
EEPROM, 103
Flash, 103
EEPROM, 114
RAM, 103
messages, Firmata library, 263–264
mice
USB, 325
microcontrollers, analog I/O and, 67–68
micro-SD cards, 20–21, 211–212
micro-USB, 326
MIDI sound cards, 292
millis( ) function, 71
min( ) function, 72
MISO (Master In-Slave Out), 118
mobile computing, 170
mobile data network
3G, 274
4G, 275
modems, 275
modems, 275
monitors
DSTN (dual-scan supertwist nematic), 227
LCD, 227
TFT (Thin Film Transistor), 227–228
MOSI (Master Out-Slave In), 118
motor board (Robot library), 357–358
motorsStop( ) function, 351
multimeters, 23
music
N
noAutoscroll( ) function, 198
noBlink( ) function, 197
noCursor( ) function, 197
noInterrupts( ) function, 78
EEPROM, 114
O
objects, EthernetClient, 157–158
Ohm's law, 49
open source, 20
OpenWRT, 363
OUTPUT pins, 66
P
packets, 152
parameters, 34
parseFloat( ) function, 94
parseInt( ) function, 94
PBASIC, 7
PCB (Printed Circuit Board), 402–404
PCI bus, 5
peek( ) function, 93
playing digital audio, 296–297
PoE (Power over Ethernet), 152
pointTo( ) function, 351
polling, 77
pow( ) function, 74
power supply, 23
load, 46
print( ) function, 88–90, 158, 195–196
println( ) function, 158
println function, 90
processInput( ) function, 264
programming. See also sketches
bootloaders, 33
embedded systems, 25
Logo, 347
pulseIn( ) function, 70
PWM (pulse-width modulation), 68
servo motors and, 243
R
RAM (Random Access Memory), 6
Arduinos and, 103
read( ) function, 104–105, 216–217
readAccelerometer( ) function, 339
readButton( ) function, 340
reading data
begin( ) function, 94
bytes, 92
end( ) function, 94
peek( ) function, 93
starting communications, 91
readIR( ) function, 383
readProx( ) function, 383
readSlider( ) function, 338–339
readTemperature( ) function, 338–339
readUV( ) function, 383
readVisible( ) function, 383
receiveData( ) function, 144
registers, 137
resistors, 23
values, 50
resolution
DAC (Digital to Analog Converter), 295
LCD, 194
TFT screen preparation, 229–230
RGB LED, Esplora library, 337–338
control board
robot personalization, 353–354
robotNameRead( ) function, 353–354
robotNameWrite( ) function, 353–354
RS-232, SPI comparison, 119
RSSI (Received Signal Strength Indication), 173
RSSI( ) function, 177
RX (receive wire), 83
S
scancodes, 324
scanNetworks( ) function, 176–177
noncooperative functions, 311–313
Schottky diodes, 55
SCLK (serial clock), 118
scrolling, LiquidCrystal library, 197–198
CD drives, 209
speed, 213
USB (Universal Serial Bus), 209–210
Arduino accepted, 214
clusters, 220
SD library
advanced usage, 220
card operations, 219
files
importing, 215
sendAnalog( ) function, 263
sendData( ) function, 144
sendDigitalPort( ) function, 263
sendEmail( ) function, 189–190
sending data, 90
sensors
serial connections
serial devices, 82
RX (receive wire), 83
TX (transmit wire), 83
Servo library, 244
servo motors
disconnecting, 245
precision, 246
PWM (pulse width modulation), 243
safety, 246
setBitOrder( ) function, 122
setClockDivider( ) function, 122, 123
setDataMode( ) function, 122
setup( ) function, 35
Arduino Ethernet Shield, 21
Arduino GSM Shield, 22
Arduino Motor Shield, 21
Arduino WiFi Shield, 22
Arduino Wireless SD Shield, 21
initial idea, 392
types, 394
Fritzing, 22
PCB (Printed Circuit Board), 402–404
short data type, 37
sin( ) function, 76
sketches, 26
comments, 33
editor, 28
empty, 28
libraries and, 378
software
running, 28
SoftwareSerial class, 99
solderless breadboards, 57
solid state, 56
source code, 25
closed source libraries, 417–418
source files, 25
SPI (Serial Peripheral Interface), 118
clock modes, 122
communications, 120
RS-232 comparison, 119
sketch, 128
SPI bus, 118
configuration, 122
squrt( ) function, 74
SS (Slave Select), 118
SSID (Service Set ID), 173
connecting to, 175
SSID( ) function, 177
statements
break, 40
stepper motors, 254
hardware, 255
stop( ) function, 158
stop bits, 86
storage
digital audio, 296
String data type, 37
string data type, 37
stringCallback( ) function, 265
strings
reading, EEPROM library, 107–108
writing, EEPROM library, 107–108
strips, breadboards, 57
surface-mounted components, 384
T
tan( ) function, 76
TCP/IP protocol, 152
DNS (Domain Name Service), 153
IP addresses, 153
MAC address, 153
text
LiquidCrystal library, 195–196
orientation, 197
TFT (Thin Film Transistor)
Arduino Esplora, 229
color, 232
hardware, 234
thermocouple, 125
third-party libraries, 377
time functions
delayMicroseconds( ), 71
millis( ), 71
tolerance of electrical components, 47
tone( ) function, 69, 295, 340–341
transistors, 56
constants, 76
cos( ) function, 76
sin( ) function, 76
tan( ) function, 76
Tunnel diodes, 55
TX (transmit wire), 83
U
UART (Universal Asynchronous Receiver/Transmitter)
data bits, 85
serial connections, starting, 87–88
stop bits, 86
unipolar stepper motors, 255–256
unsigned char data type, 36
unsigned int data type, 37
unsigned long data type, 37
updateIR( ) function, 352
USB (Universal Serial Bus), 82–83, 209–210
hubs, 325
mice, 325
micro-USB connectors, 326
USB OTG (USB On-The-Go), 324
USBH library, 327
USBHost, 322
userNameWrite( ) function, 354
V
declarations, 34
VoiceCall class (GSM), 281–281
void data type, 36
void keyword, 34
breakdown voltage, 54
digital I/O and, 65
I2C protocol, 147
voltage drop, 52
W
WaveLAN, 171
wear leveling, 114
web servers, connecting to, 159–161
WECA (Wireless Ethernet Compatibility Alliance), 171
WEP encryption, 173
WEP network, connecting, 175
while loop, 41
Wi-Fi, 171
ad-hoc mode, 171
channels, 172
infrastructure mode, 172
RSSI (Received Signal Strength Indication), 173
SSID (Service Set ID), 173
Wi-Fi Alliance, 171
WiFi library
importing, 174
server, 179
WiFi shield, testing for, 175–176
Wire.available( ) function, 142
Wire.beginTransmission( ) function, 146
Wire.endTransmission( ) function, 146
Wire.onReceive( ) function, 141–142
Wire.onRequest( ) function, 142
Wire.read( ) function, 142
Wire.requestFrom( ) function, 146
word data type, 37
WPA2 encryption, 173
WPA-2 Personal network, connecting, 175
write( ) function, 90, 104–105, 196, 199, 218
writeBlue( ) function, 338
writeGreen( ) function, 338
writeRed( ) function, 338
X-Y-Z
XMEGA series, 9
YunClient, 368