Fridolin  1.2
DieBitschubser
GroundSensor.h
gehe zur Dokumentation dieser Datei
1 #pragma once
2 
3 #include "Sensor.h"
4 
5 
14 namespace STFU
15 {
21 {
22 public:
24  static const int MAX_BRIGHTNESS = 255;
26  static const int MIN_BRIGHTNESS = 0;
27 
31  GroundSensor() = delete;
39 
44  bool left() const;
45 
50  bool right() const;
51 
59  bool middle() const;
65  int middleValue() const;
66 
71  void threshold(int);
72 
77  int threshold() const;
78 
79 private:
85  int convert(int) const;
86 
88  int m_threshold = 0.5 * MAX_BRIGHTNESS;
89 
91  DigitalSensor* _left = nullptr;
93  DigitalSensor* _right = nullptr;
95  AnalogSensor* _middle = nullptr;
96 };
97 
98 }
bool right() const
Abfrage des Rechten Bodensensors.
Definition: GroundSensor.cpp:19
bool left() const
Abfrage des Linken Bodensensors.
Definition: GroundSensor.cpp:15
Diese Klasse stellt die Initialisierung und Funktionen für Bodensensoren bereit.
Definition: GroundSensor.h:20
static const int MIN_BRIGHTNESS
Minimaler Helligkeitswert.
Definition: GroundSensor.h:26
GroundSensor()=delete
Der Defaultkonstruktor ist verboten.
Abgelteitete Sensorenklasse für analoge Sensoren.
Definition: Sensor.h:77
Abgelteitete Sensorenklasse für digitale Sensoren.
Definition: Sensor.h:56
int threshold() const
Schwellwert zur bestimmung von middle()
Definition: GroundSensor.cpp:43
Super Tolle Fridolin Utilities Alle Klassen aus dieser Bibliothek haben den Präfix: STFU.
Definition: Button.cpp:3
Enthaelt die Klassen Sensor, DigitalSensor, AnalogSensor.
int middleValue() const
Analoge Abfrage des Mittleren Bodensensors Die Grenzwerte der Helligkeit sind durch MIN_BRIGHTNESS un...
Definition: GroundSensor.cpp:27
static const int MAX_BRIGHTNESS
Maximaler Helligkeitswert.
Definition: GroundSensor.h:24
bool middle() const
Digitale Abfrage des Mittleren Bodensensors Der Wert wird mit Hilfe eins Schwellwertes bestimmt,...
Definition: GroundSensor.cpp:23