Interfacing sensors via digital I/O in Simulink
Congratulations, now the hardware system is ready to use. Let's get back to the software design. Here we will introduce the simpler approach—the Simulink method to drive the ZMotion sensor through the built-in BeagleBoard Support Package. The introduction of Simulink has been described in the previous chapter, based on which we will be able to achieve this aim quite easily.
First, let's start a new Simulink model and open the Simulink library by typing simulink
in the command window of MATLAB. Locate Simulink Support Package for BeagleBoard Hardware in the Simulink library browser and click on it; you will easily see that the GPIO driver has already been provided by the GPIO Read and GPIO Write blocks. Please go through the following steps to set up a new Simulink model to drive the ZMotion module through the BeagleBoard:
Simply drag a GPIO Read block into the system model, as shown in the following screenshot. Then double click on it to configure...