This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/AVR_Studio/Soccer/sensor/abstand.c
2007-02-15 20:15:02 +00:00

24 lines
520 B
C
Executable file

#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];
}