Kinetic Sculpture  3.1
Software to Architecture for the Junior Kinetic Sculpture Project
 All Classes Files Functions Variables Macros Pages
Public Member Functions | List of all members
Ultrasonic Class Reference

#include <Ultrasonic.h>

Public Member Functions

 Ultrasonic (byte trigger, byte echo)
 
void startMeasurement ()
 
int getDistanceInCM ()
 
float getDistanceInInches ()
 
bool inProgress ()
 

Detailed Description

Ultrasonic object class

Class to easily interact with the ultrasonic sensor written by Wade Varesio 9/14/2018

Constructor & Destructor Documentation

Ultrasonic::Ultrasonic ( byte  trigger,
byte  echo 
)
inline

Contructs an Ultrasonic object

Parameters
triggerthe pin that the ultrasonic trigger pin is associated with.
echothe pin that the ultrasonic echo pin is associated with.

Member Function Documentation

void Ultrasonic::startMeasurement ( )
inline

Starts a measurement on the ultrasonic sensor.

Start a measurement by clearing the trigger pin, then setting to high and reading from the echoPin

int Ultrasonic::getDistanceInCM ( )
inline

Return distance from the ultrasonic sensor in CM

Returns
the distance of the object from the ultrasonic sensor in CM
float Ultrasonic::getDistanceInInches ( )
inline

Return the distance in inches

Returns
the distance of the object from the ultrasonic sensor in inches
bool Ultrasonic::inProgress ( )
inline

Checks if the ultrasonic sensor is in porgress (taking a measurement)

Returns
If the ultrasonic sensor is runnning a measurment.

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