achso.. hmm...

öhm...

dann muss um den ganzen code (ab der while schleife bis zum ende von meinem code) eine if schleife, so wei du es auch gemacht hast... probier mal folgendes:



#include "asuro.h"

int main(void){

Init();
for(int k=0;k<10;k++){
PollSwitch();
}
if(PollSwitch==0){
while(PollSwitch()==0){
MotorDir(FWD,FWD);
MotorSpeed(150,150);
StatusLED(GREEN);
}

MotorDir(BREAK,BREAK);
MotorSpeed(0,0);
Msleep(666);
MotorDir(RWD,RWD);
MotorSpeed(100,100);


}else{
SerWrite("Hindernis",10);
}

}
[/code]

das sieht deinem code schon wieder verdächtig ähnlich... mmhh.. probiers mal reinzukopieren.