Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed PID mbed-rtos
Handgriffbetaetigung.cpp
00001 #include "Handgriffbetaetigung.h" 00002 00003 Handgriffbetaetigung::Handgriffbetaetigung(): poti(POTIPIN){ 00004 this->Error = false; 00005 } 00006 00007 uint16_t Handgriffbetaetigung::getValue(){ 00008 int16_t value = this->poti.read() * 100; 00009 00010 if( value == 0 ){ 00011 this->Error = true; 00012 return 0; 00013 } 00014 00015 value = value - Handgriffbetaetigung::UNTERGRENZE; 00016 if( value < 0 ) return 0; 00017 00018 value = value * 100 / (Handgriffbetaetigung::OBERGRENZE-Handgriffbetaetigung::UNTERGRENZE); 00019 00020 if( value > 100 ) return 100; 00021 return value; 00022 } 00023 00024 Handgriffbetaetigung::operator int(){ 00025 return getValue(); 00026 }
Generated on Mon Aug 1 2022 09:49:43 by
