Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DISCO-F746NG_LCDTS_demo Srf08Test
SRF08 Class Reference
The SRF08 is an ultrasonic range finder with an I2C interface that allows the measurement to be read directly in centimetres. More...
#include <SRF08.h>
Public Member Functions | |
SRF08 (PinName SDA, PinName SCL, int i2cAddress) | |
Create a SRF08 object connected to the specified I2C pins and address. | |
void | startRanging () |
Send the "Start ranging in cm" command via I2C. | |
bool | rangingFinished () |
Checks if the module has finished ranging. | |
int | getRange () |
Gets the measured range from the module. | |
int | getLightIntensity () |
Gets the measured light intensity from the module. | |
void | setRangeRegister (unsigned char rangeVal) |
Sets the range register of the SRF08 for faster ranging. | |
void | setMaxGainRegister (unsigned char gainVal) |
Sets the max gain register of the SRF08. | |
void | setAddress (int i2cAddress) |
Changes the I2C address of the SRF08. |
Detailed Description
The SRF08 is an ultrasonic range finder with an I2C interface that allows the measurement to be read directly in centimetres.
More information can be found on this website: http://www.robot-electronics.co.uk/htm/srf08tech.shtml
Definition at line 33 of file SRF08.h.
Constructor & Destructor Documentation
SRF08 | ( | PinName | SDA, |
PinName | SCL, | ||
int | i2cAddress | ||
) |
Member Function Documentation
int getLightIntensity | ( | ) |
int getRange | ( | ) |
bool rangingFinished | ( | ) |
void setAddress | ( | int | i2cAddress ) |
void setMaxGainRegister | ( | unsigned char | gainVal ) |
void setRangeRegister | ( | unsigned char | rangeVal ) |
Generated on Tue Jul 12 2022 15:01:06 by
