upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _dfrorp_context |
Functions | |
dfrorp_context | dfrorp_init (unsigned int apin, float a_ref) |
void | dfrorp_close (dfrorp_context dev) |
upm_result_t | dfrorp_update (const dfrorp_context dev) |
void | dfrorp_set_offset (const dfrorp_context dev, float offset) |
void | dfrorp_set_scale (const dfrorp_context dev, float scale) |
float | dfrorp_get_orp (const dfrorp_context dev) |
void | dfrorp_set_calibration_offset (const dfrorp_context dev, float offset) |
float | dfrorp_get_volts (const dfrorp_context dev) |
float | dfrorp_get_normalized (const dfrorp_context dev) |
Typedefs | |
typedef struct _dfrorp_context * | dfrorp_context |
dfrorp_context dfrorp_init | ( | unsigned int | apin, |
float | a_ref | ||
) |
DFRORP Initializer
apin | Analog pin to use. |
a_ref | The analog reference voltage in use |
void dfrorp_close | ( | dfrorp_context | dev | ) |
DFRORP sensor close function
upm_result_t dfrorp_update | ( | const dfrorp_context | dev | ) |
Read the sensor status and update internal state. dfrorp_update() must have been called before calling dfrorp_get_orp(), dfrorp_get_normalized(), or dfrorp_get_volts().
dev | sensor context |
void dfrorp_set_offset | ( | const dfrorp_context | dev, |
float | offset | ||
) |
Set sensor offset. This offset is applied to the ORP value before scaling. Default is 0.0.
dev | sensor context pointer |
offset | Offset to apply to the computed ORP value |
void dfrorp_set_scale | ( | const dfrorp_context | dev, |
float | scale | ||
) |
Set sensor scale. The ORP return value is scaled by this value before the offset is applied. Default is 1.0.
dev | sensor context pointer |
scale | The scale to apply to the computed ORP value |
float dfrorp_get_orp | ( | const dfrorp_context | dev | ) |
Get computed ORP (in millivolts) value from the sensor. dfrorp_update() must have been called prior to calling this function.
dev | sensor context pointer |
void dfrorp_set_calibration_offset | ( | const dfrorp_context | dev, |
float | offset | ||
) |
Set the calibration offset for the device. This is determined by disconnecting the sensor probe (but leaving the sensor interface board connected). Then run one of the examples while holding down the 'calibrate' button on the device. Read the ORP value reported.
This (low) ORP value is what you should supply to this function. Then reconnect the probe to the interface board and you should be ready to go.
DO NOT press the calibrate button on the interface board while the probe is attached or you can permanently damage the probe.
dev | sensor context pointer |
offset | The ORP offset obtained during calibration. |
float dfrorp_get_volts | ( | const dfrorp_context | dev | ) |
Get the raw measured volts from the sensor. dfrorp_update() must have been called prior to calling this function.
dev | sensor context pointer |
float dfrorp_get_normalized | ( | const dfrorp_context | dev | ) |
Get the raw normalized ADC values from the sensor. dfrorp_update() must have been called prior to calling this function.
dev | sensor context pointer |
typedef struct _dfrorp_context * dfrorp_context |
Device context