Arduino library for the I²C Sonar Range Finder SRF08
Public Member Functions | List of all members
SRF08 Class Reference

The main class of the Arduino library for the SRF08 sensor. More...

#include <SRF08.h>

Public Member Functions

 SRF08 ()
 Main constructor of the SRF08 class.
 
 SRF08 (uint8_t address)
 Constructor of the SRF08 class with non-standard i2c address. More...
 
 ~SRF08 ()
 Main destructor of the SRF08 class.
 
void init ()
 Initialize the SRF08 Sonar Range Finder.
 
bool startRangeReading ()
 Starts a new measurement with the SRF08 sensor if possible. More...
 
void startRangeReadingUNSAFE ()
 Starts a new measurement with the SRF08 sensor if possible, but without blocking features. More...
 
bool readRange ()
 Reads the current range measurement from the SRF08 sensor if possible. More...
 
void readRangeUNSAFE ()
 Reads the current range measurement from the SRF08 sensor if possible. This Methode allows unsafe range readings without minimum processing delay. More...
 
bool checkIfReadyForReading ()
 Checks if the SRF08 is ready to start a new range measurement. More...
 
int16_t getDistance ()
 Get the last measured distance of the SRF08 sensor. More...
 
uint32_t getTimeOfLastReading ()
 Get the system time at which the SRF08 sensor started the last range measurement. More...
 
uint16_t get_version ()
 Get the version of the library. More...
 

Detailed Description

The main class of the Arduino library for the SRF08 sensor.

Constructor & Destructor Documentation

◆ SRF08()

SRF08::SRF08 ( uint8_t  address)

Constructor of the SRF08 class with non-standard i2c address.

Parameters
addressnew i2c address.

Member Function Documentation

◆ startRangeReading()

bool SRF08::startRangeReading ( )

Starts a new measurement with the SRF08 sensor if possible.

Returns
true on success, else false.

◆ startRangeReadingUNSAFE()

void SRF08::startRangeReadingUNSAFE ( )

Starts a new measurement with the SRF08 sensor if possible, but without blocking features.

Returns
true on success, else false.

◆ readRange()

bool SRF08::readRange ( )

Reads the current range measurement from the SRF08 sensor if possible.

Returns
true on success, else false.

◆ readRangeUNSAFE()

void SRF08::readRangeUNSAFE ( )

Reads the current range measurement from the SRF08 sensor if possible. This Methode allows unsafe range readings without minimum processing delay.

Returns
true on success, else false.

◆ checkIfReadyForReading()

bool SRF08::checkIfReadyForReading ( )

Checks if the SRF08 is ready to start a new range measurement.

Returns
true on success, else false.

◆ getDistance()

int16_t SRF08::getDistance ( )

Get the last measured distance of the SRF08 sensor.

Returns
the current measured distance in cm.

◆ getTimeOfLastReading()

uint32_t SRF08::getTimeOfLastReading ( )

Get the system time at which the SRF08 sensor started the last range measurement.

Returns
the system time when the last measurement was started.

◆ get_version()

uint16_t SRF08::get_version ( )

Get the version of the library.

Returns
the current version of the library.

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