ti bisogna il phaserunner
Dependencies: mbed PID mbed-rtos
Handgriffbetaetigung.cpp
- Committer:
- EpicG10
- Date:
- 2019-05-09
- Revision:
- 6:a80300ee574d
File content as of revision 6:a80300ee574d:
#include "Handgriffbetaetigung.h" Handgriffbetaetigung::Handgriffbetaetigung(): poti(POTIPIN){ this->Error = false; } uint16_t Handgriffbetaetigung::getValue(){ int16_t value = this->poti.read() * 100; if( value == 0 ){ this->Error = true; return 0; } value = value - Handgriffbetaetigung::UNTERGRENZE; if( value < 0 ) return 0; value = value * 100 / (Handgriffbetaetigung::OBERGRENZE-Handgriffbetaetigung::UNTERGRENZE); if( value > 100 ) return 100; return value; } Handgriffbetaetigung::operator int(){ return getValue(); }