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.h
00001 /** 00002 * Gibt für den Handgriffbetätiger einen Wert zwischen 0x0000 und 0xFFFF zurück. 00003 */ 00004 00005 #ifndef HANDGRIFFBETAETIGUNG_H 00006 #define HANDGRIFFBETAETIGUNG_H 00007 00008 #include "mbed.h" 00009 #include "rtos.h" 00010 00011 #define POTIPIN PC_0 00012 00013 class Handgriffbetaetigung{ 00014 private: 00015 //AnalogIn-Objekt mit dem Pin des Potis 00016 AnalogIn poti; 00017 00018 //Hoechster Wert, der der Poti zurückgibt 00019 static const uint16_t OBERGRENZE = 70; 00020 00021 //Tiefster Wert, der der Poti zurückgibt 00022 static const uint16_t UNTERGRENZE = 30; 00023 00024 //Pin auf dem die Handgriffbetätigung ist 00025 static const PinName POTIPIN = PC_0; 00026 00027 //Wenn der Poti den Wert 0 misst, ist er kaputt. 00028 bool Error; 00029 00030 public: 00031 /** 00032 * Konstruiert eine Handgriffbetätigung, der den Potiwert zurückgibt. 00033 * @param aIn: AnalogIn-Objekt mit dem Pin des Potis. 00034 */ 00035 Handgriffbetaetigung(); 00036 00037 /** 00038 * Gibt den Analogwert zurück. 00039 * @return Analogwert in Prozent 00040 */ 00041 uint16_t getValue(); 00042 00043 /** 00044 * Ruft die Funktion getValue() auf 00045 * @return Analogwert in Prozent 00046 */ 00047 operator int(); 00048 }; 00049 00050 #endif
Generated on Mon Aug 1 2022 09:49:43 by
