hallo
ich weiß zwar nicht ob es hilft, aber ich würde dein programm etwas anders schreiben:
Code:
#include "asuro.h"
unsigned char taste;
int main(void)
{
Init();
while(1){
do
{
taste = PollSwitch();
}while( taste != PollSwitch() ) // somit braucht man später nicht immer kontrollieren
switch(taste) // hier wird taste auf bestimmte werte geprüft
{
case 1:
StatusLED (GREEN);
break;
case 2:
StatusLED (RED);
break;
case 4:
FrontLED (ON);
break;
case 8:
BackLED (OFF,ON);
break;
case 16:
BackLED (ON,OFF);
break;
case 32:
BackLED (ON,ON);
break;
default:
StatusLED(OFF);
BackLED(OFF,OFF);
FrontLED(OFF);
break;
}
}
while(1);
return 0;
}
Lesezeichen