PacktLib: C Programming for Arduino

C Programming for Arduino

Credits

About the Author

Acknowledgement

About the Reviewers

www.PacktPub.com

Preface

Let's Plug Things

What is a microcontroller?

Presenting the big Arduino family

About hardware prototyping

Understanding Arduino software architecture

Installing Arduino development environment (IDE)

Installing Arduino drivers

What is electricity?

Summary

First Contact with C

An introduction to programming

C and C++?

The Arduino native library and other libraries

Checking all basic development steps

Using the serial monitor

Making the Arduino talk to us

Summary

C Basics – Making You Stronger

Approaching variables and types of data

String

The scope concept

static, volatile, and const qualifiers

Operators, operator structures, and precedence

Types manipulations

Comparing values and Boolean operators

Adding conditions in the code

Making smart loops for repetitive tasks

Summary

Improve Programming with Functions, Math, and Timing

Introducing functions

C standard mathematical functions and Arduino

Approaching calculation optimization

Time measure

Summary

Sensing with Digital Inputs

Sensing the world

What does digital mean?

Introducing a new friend – Processing

Pushing the button

Playing with multiple buttons

Understanding the debounce concept

Summary

Sensing the World – Feeling with Analog Inputs

Sensing analog inputs and continuous values

Introducing Max 6, the graphical programming framework

Controlling software using hardware

Multiplexing with a CD4051 multiplexer/demultiplexer

Summary

Talking over Serial

Serial communication

Multiple serial interfaces

Summary

Designing Visual Output Feedback

Using LEDs

Multiplexing LEDs

Using RGB LEDs

Building LED arrays

Simulating analog outputs with PWM

Quick introduction to LCD

Summary

Making Things Move and Creating Sounds

Making things vibrate

Higher current driving and transistors

Controlling a servo

Multiple servos with external power supply

Controlling stepper motors

Air movement and sounds

Playing basic sound bits

Improving the sound engine with Mozzi

Controlling the sound using envelopes and MIDI

Playing audio files with the PCM library

Summary

Some Advanced Techniques

Data storage with EEPROMs

Using GPS modules

Arduino, battery, and autonomy

Drawing on gLCDs

Using VGA with the Gameduino Shield

Summary

Networking

An overview of networks

Wiring Arduino to wired Ethernet

Bluetooth communications

Playing with Wi-Fi

Tweeting by pushing a switch

Summary

Playing with Max 6 Framework

Communicating easily with Max 6 – the [serial] object

Parsing and selecting data coming from Arduino

Creating a sound-level meter with LEDs

Pitch shift effect controlled by hand

Summary

Improving your C Programming and Creating Libraries

Programming libraries

Creating your own LED-array library

Memory management

Mastering bit shifting

Reprogramming the Arduino board

Summary

Conclusion

Index