After completing this chapter, you should be able to:
- Interface to actuators, such as DC motors, stepper motors, and relays.
- Protect the BBB ADC from damage using op‐amp clamping.
- Condition a sensor signal so that it can be interfaced to the BBB ADCs, regardless of the output voltage levels.
- Interface analog sensors such as distance sensors and accelerometers to the BBB.
- Interface to low‐cost display modules such as seven‐segment displays and character LCD displays.
- Use systemd to control services and create custom services that start when the BBB boots.
- Use the BBB as a serial server, so that it can be remotely controlled.
- Use Bluetooth to communicate with the BBB and have exposure to the steps involved in desktop application or mobile application control.
- Build C/C++ code as a dynamic library to be used on the BBB.
Figure 9-A1: Chapter 9 all on one breadboard!
CMake and the exploringBB Library
The make utility and Makefiles provide a build system that can be used to manage the compilation and re-compilation of programs that are written in any programming language. I use Makefiles quite often in my projects to automate the build process; however, there are times when Makefiles become overly complex for the task — particularly when building projects that have multiple sub directories, or projects that are to be deployed to multiple platforms.
The use of Makefiles is described in Chapter 11 (Pg. 439) in order to build Gtk applications. In that context, this discussion is somewhat premature but Chapter 9 is the natural home for this material, so please treat this as a placeholder to which you can revisit after you have completed the later chapters.
The article on my blog site: Introduction to CMake by Example describes how to use CMake in your projects, describing how you can build a simple project, build shared/static libraries, and to use a shared/static library in your application code.
An Introduction to CMake by Example (click to view the article)
This video examines how we can drive stepper motors using C++ within Embedded Linux using the open source hardware EasyDriver board. The video begins by describing stepper motors and the effects of micro-stepping. It then discusses the EasyDriver Board (V4.4) and all of the available inputs and outputs. The board uses the Allegro A3967 which allows for full, half-, quarter and one eight micro-stepping. The video then explains C++ code that uses the GPIOs on the BeagleBoard to wrap the EasyDriver with a C++ class that is easy to use by creating an object of the class for each stepper motor that is connected.