Hallo Nohmal,
Also den Oben geposteten Code, der funktioniert.
RC5_Read() ist schon die omplette auslesefunktion.
Hier noch ein Porgramm was auch funzt, wo ich mit dem fünf Tasten (oben,unten,rechts,links und OK) den Bot fahren lassen kann:
Code:
word RC5_Command;
word RC5_ExtCommand;
void main(void)
{
PRO_BOT128_INIT();
RC5_Init(26);
DRIVE_ON();
while(true){
RC5_Command = RC5_Read() &0x3F;
RC5_ExtCommand = RC5_Command | ((RC5_Read() &0x1000) >> 6);
if((RC5_Command == 40) && (RC5_ExtCommand == 104)){
DRIVE(128,128);
}
if((RC5_Command == 28) && (RC5_ExtCommand == 92)){
DRIVE(255,255);
}
else{
if((RC5_Command == 27) && (RC5_ExtCommand == 91))
DRIVE(1,1);
}
if((RC5_Command == 37) && (RC5_ExtCommand == 101)){
DRIVE(50,205);
}
else{
if((RC5_Command == 36) && (RC5_ExtCommand == 100))
DRIVE(205,50);
}
}
}
Mfg
bnitram
Lesezeichen