Translating timer code from Uno to Micro ?
i have program written drive octobrite on uno. replacing uno micro. in exporting program arduino ide error message: tccr2a , additional code in segment below, not declared in scope.
below section refers to.
any advice on do??
china blue
// initialize 1ms timer interrupt
timsk2 &= ~(1<<toie2);
tccr2a &= ~((1<<wgm21) | (1<<wgm20));
tccr2b &= ~(1<<wgm22);
assr &= ~(1<<as2);
timsk2 &= ~(1<<ocie2a);
tccr2b |= (1<<cs22) | (1<<cs20);
tccr2b &= ~(1<<cs21);
tcnt2 = timer_preload;
timsk2 |= (1<<toie2);
below section refers to.
any advice on do??
china blue
// initialize 1ms timer interrupt
timsk2 &= ~(1<<toie2);
tccr2a &= ~((1<<wgm21) | (1<<wgm20));
tccr2b &= ~(1<<wgm22);
assr &= ~(1<<as2);
timsk2 &= ~(1<<ocie2a);
tccr2b |= (1<<cs22) | (1<<cs20);
tccr2b &= ~(1<<cs21);
tcnt2 = timer_preload;
timsk2 |= (1<<toie2);
quote
any advice on do??
start fixing post title. have not having troubles porting data uno micro. having troubles porting code uno micro.
quote
n exporting program arduino ide error message: tccr2a not declared in scope.
that's problem direct hardware manipulation. result not portable. you'll need @ datasheet uno, see tccr2a refers to, , @ datasheet micro figure out suitable replacement is.
Arduino Forum > Using Arduino > Programming Questions > Translating timer code from Uno to Micro ?
arduino
Comments
Post a Comment