diff options
author | sicarius <devnull@localhost> | 2007-02-15 21:15:02 +0100 |
---|---|---|
committer | sicarius <devnull@localhost> | 2007-02-15 21:15:02 +0100 |
commit | 8d7053ca84a48fe63736b1ae6225624da7b9be44 (patch) | |
tree | 0bf0e68783fcc195feee33f845b65e31e50f2772 /source/AVR_Studio/Soccer/sensor/abstand.c | |
parent | 7393d1d12c3ee23a85978d619768af645137d1ac (diff) | |
download | rc2007-soccer-8d7053ca84a48fe63736b1ae6225624da7b9be44.tar rc2007-soccer-8d7053ca84a48fe63736b1ae6225624da7b9be44.zip |
Code-Work :)
Diffstat (limited to 'source/AVR_Studio/Soccer/sensor/abstand.c')
-rwxr-xr-x | source/AVR_Studio/Soccer/sensor/abstand.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/AVR_Studio/Soccer/sensor/abstand.c b/source/AVR_Studio/Soccer/sensor/abstand.c new file mode 100755 index 0000000..5acdcaf --- /dev/null +++ b/source/AVR_Studio/Soccer/sensor/abstand.c @@ -0,0 +1,24 @@ +#include "abstand.h"
+
+Abstand::Abstand() {
+ abstand[0] = ABSTAND_FEHLER;
+ abstand[1] = ABSTAND_FEHLER;
+ abstand[2] = ABSTAND_FEHLER;
+ abstand[3] = ABSTAND_FEHLER;
+}
+
+Abstand::~Abstand() {
+}
+
+void Abstand::Aktualisieren() {
+ // Gehe alle 4 Sensoren durch
+ for(int i=0;i<4;i++) {
+ abstand[i] = board.GetAbstand(i); // Und übernehme die Werte direkt vom Sensor
+ }
+}
+
+int Abstand::GetAbstand(int i) {
+ if((i < 0) || (i > 3)) return ABSTAND_FEHLER; //angebote rausfiltern ;)
+
+ return abstand[i];
+}
|