The STEAM Org Robotics Kit  v1
Public Member Functions | List of all members
Ultrasonic Class Reference

Allows to interface with a standard ultrasonic sensor. More...

#include <Ultrasonic.h>

Public Member Functions

 Ultrasonic (u_int8_t trig, u_int8_t echo)
 
int getDistance ()
 Triggers the ir sensor and gets the distance recorded by it in centimeters. More...
 

Detailed Description

Allows to interface with a standard ultrasonic sensor.

Constructor & Destructor Documentation

◆ Ultrasonic()

Ultrasonic::Ultrasonic ( u_int8_t  trig,
u_int8_t  echo 
)
Parameters
trigThe trig pin of the ultrasonic sensor
echoThe echo pin of the ultrasonic sensor

Member Function Documentation

◆ getDistance()

int Ultrasonic::getDistance ( )

Triggers the ir sensor and gets the distance recorded by it in centimeters.

Note
The distance returned is in Centimeters
Returns
The distance in centimeters

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