Cover image for Programming Arduino next steps : going further with sketches
Title:
Programming Arduino next steps : going further with sketches
Personal Author:
Publication Information:
New York : McGraw-Hill, 2014
Physical Description:
xxii, 264 pages : illustrations ; 22 cm.
ISBN:
9780071830256
General Note:
Includes index
Abstract:
"In this practical guide, electronics guru Simon Monk takes you under the hood of Arduino and reveals professional programming secrets. Featuring coverage of the Arduino Uno, Leonardo, and Due boards, Programming Arduino Next Steps: Going Further with Sketches shows you how to use interrupts, manage memory, program for the Internet, maximize serial communications, perform digital signal processing, and much more. All of the 75+ example sketches featured in the book are available for download"--provided by publisher

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010328908 TJ223.P76 M664 2014 Open Access Book Book
Searching...

On Order

Summary

Summary

Take your Arduino skills to the next level!

In this practical guide, electronics guru Simon Monk takes you under the hood of Arduino and reveals professional programming secrets. Featuring coverage of the Arduino Uno, Leonardo, and Due boards, Programming Arduino Next Steps: Going Further with Sketches shows you how to use interrupts, manage memory, program for the Internet, maximize serial communications, perform digital signal processing, and much more. All of the 75+ example sketches featured in the book are available for download.

Learn advanced Arduino programming techniques, including how to:

Use hardware and timer interrupts Boost performance and speed by writing time-efficient sketches Minimize power consumption and memory usage Interface with different types of serial busses, including I2C, 1-Wire, SPI, and TTL Serial Use Arduino with USB, including the keyboard and mouse emulation features of the Leonardo and Due boards Program Arduino for the Internet Perform digital signal processing Accomplish more than one task at a time--without multi-threading Create and release your own code library


Author Notes

Dr. Simon Monk has a degree in Cybernetics and Computer Science and a PhD in Software Engineering. He spent several years as an academic before he returned to industry, co-founding the mobile software company Momote Ltd. Dr. Monk has been an active electronics hobbyist since his early teens and is a full-time writer on hobby electronics and open source hardware. He is the author of numerous electronics books, including Programming the Raspberry Pi: Getting Started with Python; Programming Arduino: Getting Started with Sketches; 30 Arduino Projects for the Evil Genius; Arduino + Android Projects for the Evil Genius , and Practical Electronics for Inventors , Third Edition (co-author).


Table of Contents

Acknowledgmentsp. xvii
Introductionp. xix
1 Programming Arduinop. 1
What Is Arduino?p. 1
Installation and the IDEp. 4
Installing the IDEp. 4
Blinkp. 4
A Tour of Arduinop. 7
Power Supplyp. 8
Power Connectionsp. 8
Analog Inputsp. 9
Digital Connectionsp. 9
Arduino Boardsp. 10
Uno and Similarp. 10
Big Arduino Boardsp. 11
Small Arduino Boardsp. 13
LilyPad and LilyPad USB Boardsp. 13
Unofficial Arduinosp. 13
Programming Languagep. 15
Modifying the Blink Sketchp. 15
Variablesp. 17
Ifp. 18
Loopsp. 19
Functionsp. 20
Digital Inputsp. 22
Digital Outputsp. 24
The Serial Monitorp. 24
Arrays and Stringsp. 26
Analog Inputsp. 28
Analog Outputsp. 30
Using Librariesp. 32
Arduino Data Typesp. 34
Arduino Commandsp. 35
Summaryp. 36
2 Under the Hoodp. 37
A Brief History of Arduinop. 37
Anatomy of an Arduinop. 38
AVR Processorsp. 39
ATmega328p. 39
ATmega32u4p. 41
ATmega2560p. 41
AT91SAM3X8Ep. 41
Arduino and Wiringp. 42
From Sketch to Arduinop. 46
AVR Studiop. 49
Installing a Bootloaderp. 51
Burning a Bootloader with AVR Studio and a Programmerp. 51
Burning a Bootloader with the Arduino IDE and a Second Arduinop. 53
Summaryp. 55
3 Interrupts and Timersp. 57
Hardware Interruptsp. 57
Interrupt Pinsp. 60
Interrupt Modesp. 61
Enabling Internal Pull-Upp. 61
Interrupt Service Routinesp. 62
Volatile Variablesp. 63
ISR Summaryp. 64
Enabling and Disabling Interruptsp. 64
Timer Interruptsp. 64
Summaryp. 68
4 Making Arduino Fasterp. 69
How Fast Is an Arduino?p. 69
Comparing Arduino Boardsp. 70
Speeding Up Arithmeticp. 71
Do You Really Need to Use a Float?p. 72
Lookup vs. Calculatep. 72
Fast I/Op. 75
Basic Code Optimizationp. 75
Bytes and Bitsp. 77
ATmega328 Portsp. 77
Very Fast Digital Outputp. 79
Fast Digital Inputp. 80
Speeding Up Analog Inputsp. 81
Summaryp. 83
5 Low Power Arduinop. 85
Power Consumption of Arduino Boardsp. 85
Current and Batteriesp. 87
Reducing the Clock Speedp. 88
Turning Things Offp. 90
Sleepingp. 92
Narcolepticp. 92
Waking on External Interruptsp. 94
Use Digital Outputs to Control Powerp. 97
Summaryp. 99
6 Memoryp. 101
Arduino Memoryp. 101
Minimizing RAM Usagep. 103
Use the Right Data Structuresp. 103
Be Careful with Recursionp. 104
Store String Constants in Hash Memoryp. 106
Common Misconceptionsp. 106
Measure Free Memoryp. 107
Minimizing Flash Usagep. 108
Use Constantsp. 108
Remove Unwanted Tracep. 108
Bypass the Bootloaderp. 109
Static vs. Dynamic Memory Allocationp. 109
Stringsp. 111
C char Arraysp. 111
The Arduino String Object Libraryp. 114
Using EEPROMp. 115
EEPROM Examplep. 116
Using the avr/eeprom.h Libraryp. 119
EEPROM Limitationsp. 121
Using Flashp. 121
Using SD Card Storagep. 123
Summaryp. 124
7 Using 12Cp. 125
12C Hardwarep. 127
The 12C Protocolp. 128
The Wire Libraryp. 129
Initializing 12Cp. 129
Master Sending Datap. 129
Master Receiving Datap. 130
12C Examplesp. 131
TEA5767 FM Radiop. 131
Arduino-to-Arduino Communicationp. 133
LED Backpack Boardsp. 136
DS1307 Real-Time Clockp. 137
Summaryp. 139
8 Interfacing with 1-Wire Devicesp. 141
1-Wire Hardwarep. 141
The 1-Wire Protocolp. 142
The OneWire Libraryp. 142
Initializing 1-Wirep. 143
Scanning the Busp. 143
Using the DS18B20p. 145
Summaryp. 147
9 Interfacing with SPI Devicesp. 149
Bit Manipulationp. 149
Binary and Hexp. 150
Masking Bitsp. 151
Shifting Bitsp. 152
SPI Hardwarep. 154
The SPI Protocolp. 156
The SPI Libraryp. 156
SPI Examplep. 158
Summaryp. 162
10 Serial UART Programmingp. 163
Serial Hardwarep. 163
Serial Protocolp. 165
The Serial Commandsp. 166
The SoftwareSerial Libraryp. 168
Serial Examplesp. 169
Computer to Arduino over USBp. 169
Arduino to Arduinop. 171
GPS Modulep. 174
Summaryp. 178
11 USB Programmingp. 179
Keyboard and Mouse Emulationp. 179
Keyboard Emulationp. 180
Keyboard Emulation Examplep. 181
Mouse Emulationp. 182
Mouse Emulation Examplep. 182
USB Host Programmingp. 183
USB Host Shield and Libraryp. 183
USB Host on the Arduino Duep. 188
Summaryp. 191
12 Network Programmingp. 193
Networking Hardwarep. 193
Ethernet Shieldp. 193
Arduino Ethernet/EtherTenp. 194
Arduino and WiFip. 194
The Ethernet Libraryp. 196
Making a Connectionp. 196
Setting Up a Web Serverp. 199
Making Requestsp. 200
Ethernet Examplesp. 201
Physical Web Serverp. 201
Using a JSON Web Servicep. 206
The WiFi Libraryp. 208
Making a Connectionp. 208
WiFi Specific Functionsp. 208
WiFi Examplep. 209
Summaryp. 210
13 Digital Signal Processingp. 211
Introducing Digital Signal Processingp. 211
Averaging Readingsp. 213
An Introduction to Filteringp. 215
Creating a Simple Low-Pass Filterp. 215
Arduino UnoDSPp. 217
Arduino DueDSPp. 219
Filter Code Generationp. 221
The Fourier Transformp. 224
Spectrum Analyzer Examplep. 226
Frequency Measurement Examplep. 228
Summaryp. 229
14 Managing with One Processp. 231
Making the Transition from Big Programmingp. 231
Why You Don't Need Threadsp. 232
Setup and Loopp. 232
Sense Then Actp. 233
Pause Without Blockingp. 234
The Timer Libraryp. 235
Summaryp. 237
15 Writing Librariesp. 239
When to Make a Libraryp. 239
Using Classes and Methodsp. 240
Library Example (TEA5767 Radio)p. 240
Define the APIp. 241
Write the Header Filep. 243
Write the Implementation Filep. 243
Write the Keywords Filep. 244
Make the Examples Folderp. 245
Testing the Libraryp. 246
Releasing the Libraryp. 246
Summaryp. 247
A Partsp. 249
Arduino Boardsp. 249
Shieldsp. 249
Components and Modulesp. 250
Suppliersp. 250
Indexp. 251