Ultrasound Sensor - Libelium Smart Cities PRO Technical Manual

Table of Contents

Advertisement

6.2.5. Ultrasound sensor

Regarding the ultrasound sensor, the user must define an object from the
user must define the socket used in the class constructor. The available sockets for the ultrasound sensor are:
sockets 1, 2, 3, 4 and 5 for the OEM line, and sockets A, B, C, E and F for the Plug and Sense! line. For instance:
ultrasoundCitiesSensor ultrasound(SOCKET_E);
The next lines describe how to switch on the sensor, get a measurement and switch it off to save energy. The value
returned by the reading function is a uint16_t variable type:
ultrasound.ON();
ultrasound.getDistance();
ultrasound.OFF();
You can find a complete example code for reading the distance in the following link:
www.libelium.com/development/waspmote/examples/scp-v30-06-ultrasound-sensor
Board configuration and programming
ultrasoundCitiesSensor
-85-
class. The
v7.3

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Smart Cities PRO and is the answer not in the manual?

Table of Contents