diff options
author | sicarius <devnull@localhost> | 2007-02-15 20:03:00 +0100 |
---|---|---|
committer | sicarius <devnull@localhost> | 2007-02-15 20:03:00 +0100 |
commit | 7393d1d12c3ee23a85978d619768af645137d1ac (patch) | |
tree | b5892ace1b01dc00c75f284b7dc221b3278fb1b6 /source/AVR_Studio/Soccer/sensor | |
parent | c6ec20e5e7aec1b17d09102a67cccc002444dd14 (diff) | |
download | rc2007-soccer-7393d1d12c3ee23a85978d619768af645137d1ac.tar rc2007-soccer-7393d1d12c3ee23a85978d619768af645137d1ac.zip |
Code-Work :)
Diffstat (limited to 'source/AVR_Studio/Soccer/sensor')
-rwxr-xr-x | source/AVR_Studio/Soccer/sensor/ballsensor.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/AVR_Studio/Soccer/sensor/ballsensor.c b/source/AVR_Studio/Soccer/sensor/ballsensor.c index 8136581..d26b12c 100755 --- a/source/AVR_Studio/Soccer/sensor/ballsensor.c +++ b/source/AVR_Studio/Soccer/sensor/ballsensor.c @@ -34,7 +34,10 @@ void Ballsensor::Aktualisieren() { // Suche den kleinsten Wert
for(int i=0;i<NUM_BALLSENSOR;i++) {
// Wenn der Sensorwert kleiner ist ist der Ball näher dran
- if(sensor[i] < current) result = i; // Ergebnis ist erstmal index
+ if(sensor[i] < current) {
+ result = i; // Ergebnis ist erstmal index
+ current = sensor[i]; // Setze neuen Vergleichswert
+ }
}
// Setze den Winkel zum index result
|