ti bisogna il phaserunner
Dependencies: mbed PID mbed-rtos
Peripherien/Daumenbetaetigung.cpp
- Committer:
- EpicG10
- Date:
- 2019-05-16
- Revision:
- 7:15e6fc689368
- Parent:
- Daumenbetaetigung.cpp@ 6:a80300ee574d
- Child:
- 9:56aed8c6779f
File content as of revision 7:15e6fc689368:
#include "Daumenbetaetigung.h" Daumenbetaetigung::Daumenbetaetigung(): poti(PC_3){ this->Error = false; } uint16_t Daumenbetaetigung::getValue(){ int16_t value = this->poti.read() * 100; if( value == 0 ){ this->Error = true; return 0; } value = value - Daumenbetaetigung::UNTERGRENZE; if( value < 0 ) return 0; value = value * 100 / (Daumenbetaetigung::OBERGRENZE-Daumenbetaetigung::UNTERGRENZE); if( value > 100 ) return 100; return value; } Daumenbetaetigung::operator int(){ return getValue(); }