Programming the BeagleBone

Master BeagleBone programming by doing simple electronics and Internet of Things projects

Programming the BeagleBone

Yogesh Chavan

Master BeagleBone programming by doing simple electronics and Internet of Things projects
Mapt Subscription
FREE
€29.98/m after trial
eBook
€18.48
RRP €26.38
Save 29%
Print + eBook
€26.99
RRP €26.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
€0.00
€18.48
€26.99
€29.98p/m after trial
RRP €26.38
RRP €26.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781784390013
Paperback180 pages

Book Description

The whole world is moving from desktop computers to smartphones and embedded systems. We are moving towards utilizing Internet of Things (IoT). An exponential rise in the demand for embedded systems and programming in the last few years is driving programmers to use embedded development boards such as Beaglebone.

BeagleBone is an ultra-small, cost-effective computer that comes with a powerful hardware. It runs a full-fledged Debian Linux OS and provides numerous electronics solutions. BeagleBone is open source and comes with an Ethernet port, which allows you to deploy IoT projects without any additions to the board. It provides plenty of GPIO, Anlaog pins, and UART, I2C, SPI pins which makes it the right choice to perform electronics projects. This gives you all the benefits of Linux kernel such as multitasking, multiusers, and extensive device driver support. This allows you to do programming in many languages including high-level languages such as JavaScript and Python.

This book aims to exploit the hardware and software capabilities of BeagleBone to create real-life electronics and IoT applications quickly. It is divided into two parts. The first part covers JavaScript programs. The second part provides electronics projects and IoT applications in Python.

First, you will learn to use BeagleBone as tool to write useful applications on embedded systems. Starting with the basics needed to set up BeagleBone and the Cloud9 IDE, this book covers interfacing with various electronics components via simple programs. The electronics theory related to these components is then explained in depth before you use them in a program. Finally, the book helps you create some real-life IoT applications.

Table of Contents

Chapter 1: Cloud9 IDE
BeagleBone hardware
Installing Debian image on SD card
Setting up BeagleBone
The bone101 page
Cloud9 IDE
Hello World program
Summary
Chapter 2: Blinking Onboard LEDs
Digital I/O
Digital I/O functions - pinMode() and digitalWrite()
Program to turn onboard LED ON and OFF
Quick program to blink onboard LED
Make our program better
Dancing LEDs
Dancing LEDs in both directions
Summary
Chapter 3: Blinking External LEDs
What is GPIO?
BeagleBone GPIO map
Blinking external LED circuit setup
Program to blink external LED
Dancing external LEDs circuit setup
Program to dance external LEDs in both directions
Summary
Chapter 4: Controlling LED Using a Push Button
Reading from digital components
Push button circuit setup
Program to read from push button
Reading via interrupts
Push button LED circuit setup
Program to control LED by push button
Summary
Chapter 5: Reading from Analog Sensors
Analog I/O
Reading from analog components
TMP36 temperature sensor circuit setup
Program to print temperature
LDR circuit setup
Program to check light intensity
Summary
Chapter 6: PWM – Writing Analog Information
What is PWM?
BeagleBone's PWM
Writing on analog components
Fading LED circuit setup
Program to fade in and fade out LED
Micro servo motor circuit setup
Program to control a micro servo motor
Summary
Chapter 7: Internet of Things with BeagleBone
Why the Internet of Things?
What is the Internet of Things?
Program for creating new Node.js HTTP server
Program to control an LED through web browser
Controlling a servo motor through LAN
Sending an e-mail on over-temperature
Summary
Chapter 8: Physical Computing in Python
Python programming in BeagleBone
Program to blink external LEDs
Program to dance external LEDs
Program to read from push button
Program to print temperature
A Program to check light intensity
Program to fade in and fade out LED
Program to control micro servo motor
Summary
Chapter 9: UART, I2C, and SPI Programming
Bus and bus protocols
What is UART?
Program to read/write on UART
I2C protocol
Program to read from ADXL345 sensor
SPI protocol
Program to write display text on Nokia 5110 LCD
Summary
Chapter 10: Internet of Things using Python
Flask web application framework
A program to display temperature remotely
A program to control an LED through a web browser
A RESTful web app to control servo motor
A program to trigger an e-mail alert on over-temperature
Upload server data on cloud and visualize
What's next?
Security
Summary

What You Will Learn

  • Connect your BeagleBone to a computer in different ways and get the Cloud9 IDE running to quick-start programming on the BeagleBone
  • Get to know about BeagleBone extension pins such as GPIO and how to connect various electronics components with BeagleBone
  • Read and write to various electronics components such as LED, Push-button, sensors, and motors
  • Grasp in-depth theory on Analog, PWM, and BUS programming and the electronics components used in programs
  • Handle data to and from various BUS supporting modules such as UART, I2C, and SPI using the Adafruit BBIO Python library
  • Write real-life IoT applications in JavaScript and Python such as shooting an e-mail on overheat and controlling a servo motor remotely
  • Make use of online free cloud services to store and analyze sensor data collected on the BeagleBone
  • Discover what else can be done using the BeagleBone
  • Get to grips with embedded system BUS communication

Authors

Table of Contents

Chapter 1: Cloud9 IDE
BeagleBone hardware
Installing Debian image on SD card
Setting up BeagleBone
The bone101 page
Cloud9 IDE
Hello World program
Summary
Chapter 2: Blinking Onboard LEDs
Digital I/O
Digital I/O functions - pinMode() and digitalWrite()
Program to turn onboard LED ON and OFF
Quick program to blink onboard LED
Make our program better
Dancing LEDs
Dancing LEDs in both directions
Summary
Chapter 3: Blinking External LEDs
What is GPIO?
BeagleBone GPIO map
Blinking external LED circuit setup
Program to blink external LED
Dancing external LEDs circuit setup
Program to dance external LEDs in both directions
Summary
Chapter 4: Controlling LED Using a Push Button
Reading from digital components
Push button circuit setup
Program to read from push button
Reading via interrupts
Push button LED circuit setup
Program to control LED by push button
Summary
Chapter 5: Reading from Analog Sensors
Analog I/O
Reading from analog components
TMP36 temperature sensor circuit setup
Program to print temperature
LDR circuit setup
Program to check light intensity
Summary
Chapter 6: PWM – Writing Analog Information
What is PWM?
BeagleBone's PWM
Writing on analog components
Fading LED circuit setup
Program to fade in and fade out LED
Micro servo motor circuit setup
Program to control a micro servo motor
Summary
Chapter 7: Internet of Things with BeagleBone
Why the Internet of Things?
What is the Internet of Things?
Program for creating new Node.js HTTP server
Program to control an LED through web browser
Controlling a servo motor through LAN
Sending an e-mail on over-temperature
Summary
Chapter 8: Physical Computing in Python
Python programming in BeagleBone
Program to blink external LEDs
Program to dance external LEDs
Program to read from push button
Program to print temperature
A Program to check light intensity
Program to fade in and fade out LED
Program to control micro servo motor
Summary
Chapter 9: UART, I2C, and SPI Programming
Bus and bus protocols
What is UART?
Program to read/write on UART
I2C protocol
Program to read from ADXL345 sensor
SPI protocol
Program to write display text on Nokia 5110 LCD
Summary
Chapter 10: Internet of Things using Python
Flask web application framework
A program to display temperature remotely
A program to control an LED through a web browser
A RESTful web app to control servo motor
A program to trigger an e-mail alert on over-temperature
Upload server data on cloud and visualize
What's next?
Security
Summary

Book Details

ISBN 139781784390013
Paperback180 pages
Read More

Read More Reviews

Recommended for You

BeagleBone Robotic Projects Book Cover
BeagleBone Robotic Projects
€ 23.98
€ 16.80
BeagleBone Black Cookbook Book Cover
BeagleBone Black Cookbook
€ 39.58
€ 27.72
BeagleBone Black Cookbook Book Cover
BeagleBone Black Cookbook
€ 39.58
€ 27.72
BeagleBone Home Automation Book Cover
BeagleBone Home Automation
€ 16.78
€ 11.76
Python Machine Learning Book Cover
Python Machine Learning
€ 39.58
€ 27.72
Mastering BeagleBone Robotics Book Cover
Mastering BeagleBone Robotics
€ 26.38
€ 18.48