|
Noiasca Current Loop
A light weight Arduino library to read from current loop sensors (4mA - 20mA).
|
Current Loop Sensor class. More...
#include <NoiascaCurrentLoop.h>
Public Member Functions | |
| CurrentLoopSensor (uint8_t pin, uint16_t resistor, byte vref, uint16_t maxValue, uint16_t adcResolution=1024) | |
| constructor for current loop sensor More... | |
| int | begin () |
| initialize sensor More... | |
| void | check () |
| check routine More... | |
| int | getAdc () |
| return result More... | |
| int | getValue () |
| return result do the measurement and return the result More... | |
Current Loop Sensor class.
| CurrentLoopSensor::CurrentLoopSensor | ( | uint8_t | pin, |
| uint16_t | resistor, | ||
| byte | vref, | ||
| uint16_t | maxValue, | ||
| uint16_t | adcResolution = 1024 |
||
| ) |
constructor for current loop sensor
This constructor is used for a simple current loop sensor connected to one pin.
| pin | the GPIO |
| resistor | the Ohm value of the used resistor |
| vref | the reference voltage of the ADC (i.e. the system voltage) |
| maxValue | the maximal output value of the sensor |
| adcResolution | the resolution of the ADC. In case of an Arduino Uno 1024. Default 1024 |
| int CurrentLoopSensor::begin | ( | ) |
initialize sensor
Start the sensor in setup()
| void CurrentLoopSensor::check | ( | ) |
check routine
run this function once to check the validity of your values
| int CurrentLoopSensor::getAdc | ( | ) |
return result
return the previous measured raw ADC value (for test purposes only)
| int CurrentLoopSensor::getValue | ( | ) |
return result do the measurement and return the result