Ok hier also der Code aufs nötigste reduziert
Code:
uint8_t RC(uint8_t kanal)
{
if (kanal == 1)
{
while(!(PINA&8));
timer=0;
while(PINA&8);
return (timer);
}
if (kanal == 2)
{
while(!(PINA&4));
timer=0;
while(PINA&4);
return (timer);
}
return(0);
}
void moveCommand(behaviour_command_t * cmd)
{
RCcount=RC(1);
RCcount2=RC(2);
writeInteger(RCcount,10);
writeChar('\n');
}
int16_t main(void)
{
initRP6Control();
DDRA &= ~ADC3;
DDRA &= ~ADC2;
PORTA &= ~12;
startStopwatch6();
startStopwatch7();
writeInteger(timer,10);
mSleep(200);
writeInteger(timer,10);
while(true)
{
moveCommand(0);
}
return 0;
}
Hier kommt immer 0 heraus. 
mfg blenderkid
Lesezeichen