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
Daumenbetaetigung.cpp
00001 #include "Daumenbetaetigung.h" 00002 00003 Daumenbetaetigung::Daumenbetaetigung(): poti(POTIPIN){ //POTIPIN = PC_3 00004 this->Error = false; 00005 } 00006 00007 uint16_t Daumenbetaetigung::getValue(){ 00008 int16_t value = this->poti.read() * 100; 00009 if( value == 0 ){ 00010 this->Error = true; 00011 return 0; 00012 } 00013 00014 value = value - Daumenbetaetigung::UNTERGRENZE; 00015 if( value < 0 ) return 0; 00016 00017 value = value * 100 / (Daumenbetaetigung::OBERGRENZE-Daumenbetaetigung::UNTERGRENZE); 00018 00019 if( value > 100 ) return 100; 00020 return value; 00021 } 00022 00023 Daumenbetaetigung::operator int(){ 00024 return getValue(); 00025 }
Generated on Mon Aug 1 2022 09:49:43 by
