upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _otp538u_context |
Functions | |
otp538u_context | otp538u_init (int pinA, int pinO, float aref) |
void | otp538u_close (otp538u_context dev) |
upm_result_t | otp538u_get_ambient_temperature (const otp538u_context dev, float *temperature) |
upm_result_t | otp538u_get_object_temperature (const otp538u_context dev, float *temperature) |
void | otp538u_set_voltage_offset (const otp538u_context dev, float offset) |
void | otp538u_set_output_resistence (const otp538u_context dev, int resistance) |
void | otp538u_set_ivref (const otp538u_context dev, float vref) |
void | otp538u_set_debug (const otp538u_context dev, bool enable) |
Typedefs | |
typedef struct _otp538u_context * | otp538u_context |
otp538u_context otp538u_init | ( | int | pinA, |
int | pinO, | ||
float | aref | ||
) |
OTP538U constructor
pinA | Analog pin to use for the ambient temperature |
pinO | Analog pin to use for the object temperature |
aref | Analog reference voltage |
void otp538u_close | ( | otp538u_context | dev | ) |
OTP538U destructor
dev | Device context |
upm_result_t otp538u_get_ambient_temperature | ( | const otp538u_context | dev, |
float * | temperature | ||
) |
Gets the ambient temperature in Celsius
dev | Device context |
temp | Ambient temperature |
upm_result_t otp538u_get_object_temperature | ( | const otp538u_context | dev, |
float * | temperature | ||
) |
Gets the object temperature in Celsius
dev | Device context |
temp | Object temperature |
void otp538u_set_voltage_offset | ( | const otp538u_context | dev, |
float | offset | ||
) |
Sets the offset voltage
The Seeed Studio wiki gives an example of calibrating the sensor and calculating the offset voltage to apply. Currently, the default value is set, but you can use the function to set one of your own.
dev | Device context |
vOffset | Desired offset voltage |
void otp538u_set_output_resistence | ( | const otp538u_context | dev, |
int | resistance | ||
) |
Sets the output resistance value
The Seeed Studio wiki example uses a value of 2,000,000 in one of the equations used to calculate voltage. The value is the resistance of a resistor they use in the output stage of their SIG2 output. This was 'decoded' by looking at the EAGLE* files containing their schematics for this device.
dev | Device context |
outResistance | Value of the output resistor; default is 2M Ohm |
void otp538u_set_ivref | ( | const otp538u_context | dev, |
float | vref | ||
) |
Sets the reference voltage of the internal Seeed Studio voltage regulator on the sensor board.
The Seeed Studio wiki example uses a value of 2.5 in one of the equations used to calculate the resistance of the ambient thermistor. The value is the voltage of an internal voltage regulator used on the sensor board. This was 'decoded' by looking at the EAGLE files containing their schematics for this device.
dev | Device context |
vref | Reference voltage of the internal sensor; default is 2.5 |
void otp538u_set_debug | ( | const otp538u_context | dev, |
bool | enable | ||
) |
Enable debugging output (linux platforms only).
dev | Device context |
enable | true to enable some debug output, false otherwise |
typedef struct _otp538u_context * otp538u_context |
device context