[ vii ]
Chapter 3, Interacting with Digital Outputs with Python, teaches us how to work with
two different libraries to control digital outputs in Python: mraa and wiring-x86. We
will connect LEDs and resistors to a breadboard and write code to turn on between
0 to 9 LEDs. Then, we will improve our Python code to take advantage of Python's
object-oriented features, and we will prepare the code to make it easy to build an API
that will allow us to print numbers with LEDs with a REST API.
Chapter 4, Working with a RESTful API and Pulse Width Modulation, has us working
with Tornado Web Server, Python, the HTTPie command-line HTTP client, and the
mraa and wiring-x86 libraries. We will generate many versions of RESTful APIs that
will allow us to interact with the board in computers and devices connected to the
LAN. We will be able to compose and send HTTP requests that print numbers in
LEDs, change the brightness levels for three LEDs, and generate millions of colors
with an RGB LED.
Chapter 5, Working with Digital Inputs, Polling and Interrupts, explains the difference
between reading pushbutton statuses with polling and working with interrupts and
interrupt handlers. We will write code that will allow the user to perform the same
actions with either pushbuttons in the breadboard or HTTP requests. We will combine
code that reacts to changes in the statuses of the pushbuttons with a RESTful API built
with Tornado Web Server. We will create classes to encapsulate pushbuttons and the
necessary congurations with the mraa and wiring-x86 libraries.
Chapter 6, Working with Analog Inputs and Local Storage, explains how to work with
analog inputs to measure voltage values. We will measure voltages with an analog
pin and both the mraa and the wiring-x86 libraries. We will be able to transform a
variable resistor into a voltage source and make it possible to measure the darkness
level with an analog input, a photoresistor, and a voltage divider. We will re actions
when the environment light changes, and we will work with both analog inputs and
outputs. We will register events by taking advantage of the logging features included
in the Python standard library and the USB 2.0 connector included in the Intel
Galileo Gen 2 board.
Chapter 7, Retrieving Data From the Real World with Sensors, has us working with a
variety of sensors to retrieve data from the real world. We will take advantage of
the modules and classes included in the upm library that will make it easy for us
to start working with analog and digital sensors. We will learn the importance of
considering units of measurement because sensors always provide values measured
in a specic unit, which we must consider. We will measure the magnitude and
direction of proper acceleration or g-force, ambient temperature, and humidity.
www.it-ebooks.info