Go to the source code of this file.
◆ enc03r_init()
ENC03R sensor constructor
- Parameters
-
pin | Analog pin to use |
vref | Reference voltage to use; default is 5.0 V |
- Returns
- Device context
◆ enc03r_close()
ENC03R destructor
- Parameters
-
◆ enc03r_update()
Update the internal state with the current reading. This function must be called prior to calling enc03r_angular_velocity().
- Parameters
-
- Returns
- UPM result
◆ enc03r_calibrate()
upm_result_t enc03r_calibrate |
( |
const enc03r_context |
dev, |
|
|
unsigned int |
samples |
|
) |
| |
Calibrates the sensor by determining an analog reading over many samples with no movement of the sensor. This must be done before attempting to use the sensor.
- Parameters
-
dev | Device context |
samples | Number of samples to use for calibration |
- Returns
- UPM result
◆ enc03r_calibration_value()
Returns the currently stored calibration value
- Parameters
-
- Returns
- Current calibration value
◆ enc03r_angular_velocity()
Return the computed Angular Velocity in degrees per second. You must have called encr03r_update() prior to calling this function.
- Parameters
-
- Returns
- Computed angular velocity
◆ enc03r_set_offset()
Set sensor offset. The offset is applied to the return value before scaling. Default is 0.
- Parameters
-
dev | Device context |
offset | Offset to apply to value |
◆ enc03r_set_scale()
Set sensor scale. The return value is scaled by this value after the offset is applied. Default is 1.0.
- Parameters
-
dev | Device context |
scale | Scale to apply to value |
◆ enc03r_get_normalized()
Get a normalized ADC value from the sensor. The return value will be between 0.0 (indicating no voltage) and 1.0 indicating max voltage (aref). encr03r_update() must be called prior to calling this function.
- Parameters
-
- Returns
- The normalized reading from the ADC.
◆ enc03r_context