Maxbotix library

Fork of MaxbotixDriver by Daniel Casner

Embed: (wiki syntax)

« Back to documentation index

Sonar Class Reference

Sonar Class Reference

Object representation of a sonar instance. More...

#include <sonar.h>

Public Member Functions

 Sonar (PinName input, Timer &t)
 Sets up the driver and starts taking measurements.
int read ()
 Returns range in cm as int.
 operator int ()
 Returns the range in CM as an int.

Detailed Description

Object representation of a sonar instance.

Definition at line 15 of file sonar.h.


Constructor & Destructor Documentation

Sonar ( PinName  input,
Timer &  t 
)

Sets up the driver and starts taking measurements.

Parameters:
inputThe pin to read pulses from
tA running timer instance used to measure pulse width. Note that the timer must have been started or results will be invalid.

Definition at line 3 of file sonar.cpp.


Member Function Documentation

operator int (  )

Returns the range in CM as an int.

Definition at line 16 of file sonar.cpp.

int read (  )

Returns range in cm as int.

Definition at line 12 of file sonar.cpp.