O'Reilly logo

Rapid BeagleBoard Prototyping with MATLAB and Simulink by Dr.Fei Qin, Dr. Xuewu Dai

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interfacing sensors via a serial port in C

In the last section, the ZMotion IR sensor was connected to the BeagleBoard through the digital I/O interface, and successfully acquired the value of the ZMotion module into Simulink by using the GPIO Write block and the GPIO Read block. In this section, we will not only discuss how to connect a sensor based on a different interface (that is, serial communication) but also how to develop a software driver to communicate with the sensor. We will use the textual C code approach in this section, and you can migrate the code into a S-Function block for graphical programming in Simulink, which will be discussed later.

Firstly, let's get back to the datasheet of the ZMotion module. To select the Serial Interface ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required