summaryrefslogtreecommitdiffstats
path: root/source/AVR_Studio/Soccer/sensor
diff options
context:
space:
mode:
authorsicarius <devnull@localhost>2007-02-15 20:03:00 +0100
committersicarius <devnull@localhost>2007-02-15 20:03:00 +0100
commit7393d1d12c3ee23a85978d619768af645137d1ac (patch)
treeb5892ace1b01dc00c75f284b7dc221b3278fb1b6 /source/AVR_Studio/Soccer/sensor
parentc6ec20e5e7aec1b17d09102a67cccc002444dd14 (diff)
downloadrc2007-soccer-7393d1d12c3ee23a85978d619768af645137d1ac.tar
rc2007-soccer-7393d1d12c3ee23a85978d619768af645137d1ac.zip
Code-Work :)
Diffstat (limited to 'source/AVR_Studio/Soccer/sensor')
-rwxr-xr-xsource/AVR_Studio/Soccer/sensor/ballsensor.c5
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