Funktioniert leider immer noch nicht richtig.

Asuro reagiert so als ob immer Taster 6 (also Rückgabewert 1) aktiviert wäre.

Blockiere ich nun den rechten Motor reagiert Asuro als ob K5 gedrückt worden wäre (also Rückgabewert 2).

Woran könnte es denn liegen?

Falsche Batterien? Kalte Lötstellen?

Fehler im Programm ?

Code:
#include "asuro.h"
int main(void)
{
	int count;
	Init();
	
while (1) 
{
int poltest1 = PollSwitch();
int poltest2 = PollSwitch();
int poltest3 = PollSwitch();

if (poltest1 == poltest2 && poltest1 == poltest3) 
	{
	if (poltest1==0) /*Keine Kollision, volle Kraft nach vorn*/
		{		
		StatusLED(GREEN);
		MotorDir(FWD,FWD);
		MotorSpeed(220,220);
		}
	else if (poltest1==32) /*Hinderniss, vorne links*/
		{
		StatusLED(YELLOW);
		BackLED(ON,OFF);
		MotorDir(FWD,RWD);
		MotorSpeed(200,150);
		for(count=0;count<=100;count++) {Sleep(216);};
		}
	else if (poltest1==1) /*Hinderniss, vorne rechts*/
		{
		StatusLED(YELLOW);
		BackLED(OFF,ON);
		MotorDir(RWD,FWD);
		MotorSpeed(150,200);
		for(count=0;count<=100;count++) {Sleep(216);};
		}
	else if (poltest1==16) /*Hinderniss, mehr vorne, weniger links*/
		{
		StatusLED(GREEN);
		BackLED(ON,OFF);
		MotorDir(RWD,RWD);
		MotorSpeed(100,200);
		for(count=0;count<=100;count++) {Sleep(216);};
		}
	else if (poltest1==2) /*Hinderniss, mehr vorne, weniger rechts*/
		{
		StatusLED(GREEN);
		BackLED(OFF,ON);
		MotorDir(RWD,RWD);
		MotorSpeed(200,100);
		for(count=0;count<=100;count++) {Sleep(216);};
		}
	else if (poltest1==18) /*Hinderniss, vorne 90°, nach rechts abdrehen*/
		{
		StatusLED(YELLOW);
		BackLED(ON,ON);
		MotorDir(RWD,RWD);
		MotorSpeed(200,170);
		for(count=0;count<=200;count++) {Sleep(216);};
		}
	else
		{
		StatusLED(RED);
		MotorDir(RWD,RWD);
		MotorSpeed(170,170);
		for(count=0;count<=150;count++) {Sleep(216);};
		MotorDir(FWD,RWD);
		MotorSpeed(170,170);
		for(count=0;count<=25;count++) {Sleep(216);};
		};
	}
else {BackLED(OFF,OFF);}
	};	
	return 0;
}
[/code]