|
ArduinoBasicIO
1.0
Make basic operations with Arduino easier
|
Public Member Functions | |
| void | initPot (uint8_t potPin, uint16_t sectors=2) |
| uint16_t | lastSector () |
| boolean | sectorChanged () |
| void | setOnSectorChangedAction (void(*action)(uint16_t)) |
| void | update () |
| uint16_t | getValue () |
| uint16_t | getSector () |
| void | setSectors (uint16_t sectors) |
Public Member Functions inherited from AnalogInputPin | |
| AnalogInputPin () | |
| AnalogInputPin (uint8_t pin) | |
| virtual | ~AnalogInputPin () |
| int | readAverage (unsigned int nSamples) |
| int | readAverage (unsigned int nSamples, unsigned int period) |
| uint8_t | to8bit (int n) |
| uint8_t | readto8bit () |
Public Member Functions inherited from ArduinoPin | |
| ArduinoPin () | |
| ArduinoPin (uint8_t pin) | |
| virtual | ~ArduinoPin () |
| void | setPinMode (uint8_t mode) |
| void | setPin (uint8_t pin) |
| void | initPin (uint8_t pin, uint8_t mode) |
| void | initOutput (uint8_t pin) |
| void | initInput (uint8_t pin) |
| void | initOutput () |
| void | initInput () |
| virtual int | readDigital () |
| virtual int | readAnalog () |
| virtual void | writeDigital (uint8_t value) |
| virtual void | writeAnalog (uint8_t value) |
Additional Inherited Members | |
Protected Attributes inherited from ArduinoPin | |
| uint8_t | arduinoPin |
| uint16_t SimplePotentiometer::getSector | ( | ) |
Reads sector from pot input.
| uint16_t SimplePotentiometer::getValue | ( | ) |
Reads value from pot input.
| void SimplePotentiometer::initPot | ( | uint8_t | potPin, |
| uint16_t | sectors = 2 |
||
| ) |
Inits potentiometer.
| potPin | Arduino pin. |
| sectors | Number of sectors in which analog input will be divided linearly. |
| uint16_t SimplePotentiometer::lastSector | ( | ) |
Gets last known sector
| boolean SimplePotentiometer::sectorChanged | ( | ) |
Check if sector changed
| void SimplePotentiometer::setOnSectorChangedAction | ( | void(*)(uint16_t) | action | ) |
Sets action to perform when sector changed.
| void SimplePotentiometer::setSectors | ( | uint16_t | newSectors | ) |
Sets the number of sectors in which analog input will be divided linearly. Minimum is 1. Sector will be named [0,newSector-1]
| void SimplePotentiometer::update | ( | ) |
Updates pot activity. If sector changed and setctorChangedAction then will be called-