JM9 XRCU Board 0.1.2
Libraries API Reference
Loading...
Searching...
No Matches
Uts_us016 Class Reference

Ultrasonic Sensor Driver (US-016) for XRCU. More...

#include <Uts_us016.h>

Inheritance diagram for Uts_us016:
Uts_general Supported_sensor Supported_module

Public Member Functions

 Uts_us016 (const uint8_t init_ain_channel)
 Creates a new Uts_us016 object.
 
void set_range_pin_voltage_level (const bool is_vcc=DEFAULT_RANGE_PIN_IS_VCC)
 Sets whether the Range pin on this ultrasonic sensor is connected to VCC or GND.
 
uint16_t read_dist_mm ()
 Reads the distance between this ultrasonic sensor and the obstacle in front of it.
 
- Public Member Functions inherited from Uts_general
virtual bool begin ()
 Activates this ultrasonic sensor.
 
virtual void end ()
 Deactivates this ultrasonic sensor.
 
uint16_t read_dist_cm ()
 Reads the distance between this ultrasonic sensor and the obstacle in front of it.
 

Additional Inherited Members

- Protected Member Functions inherited from Uts_general
virtual void set_beginned (bool is_beginned)
 Sets whether this ultrasonic sensor is activated.
 
bool is_beginned ()
 Checks if this ultrasonic sensor is already activated.
 
void store_prev_dist_mm (uint16_t dist_mm)
 Stores the previous measured distance.
 
uint16_t get_prev_dist_mm ()
 Gets the previous measured distance.
 
 Uts_general ()
 Constructor for a generic ultrasonic sensor driver.
 
- Protected Member Functions inherited from Supported_sensor
 Supported_sensor ()
 Creates an object of a supported sensor.
 
- Protected Member Functions inherited from Supported_module
 Supported_module ()
 Creates an object of a supported module.
 
- Static Protected Attributes inherited from Uts_general
static const uint16_t ERROR_DIST_MM = 8888
 The distance representing a measurement error (in millimeters).
 

Detailed Description

Ultrasonic Sensor Driver (US-016) for XRCU.

Ultrasonic Sensor Driver. Analog mode (US-016).

Author
YH Choi @ JM9

Constructor & Destructor Documentation

◆ Uts_us016()

Uts_us016::Uts_us016 ( const uint8_t init_ain_channel)

Creates a new Uts_us016 object.

Parameters
init_ain_channelthe analog input channel hooked up to the ultrasonic sensor

Member Function Documentation

◆ read_dist_mm()

uint16_t Uts_us016::read_dist_mm ( )
virtual

Reads the distance between this ultrasonic sensor and the obstacle in front of it.

Returns
the distance between this ultrasonic sensor and the obstacle in front of it (in millimeters)

Reimplemented from Uts_general.

◆ set_range_pin_voltage_level()

void Uts_us016::set_range_pin_voltage_level ( const bool is_vcc = DEFAULT_RANGE_PIN_IS_VCC)

Sets whether the Range pin on this ultrasonic sensor is connected to VCC or GND.

Parameters
is_vcctrue if the Range pin is connected to VCC, false if the Range pin is connected to GND; leave this parameter blank if the Range pin is not connected to anything

The documentation for this class was generated from the following files: