hi folks!
i just tried out the auduino-synth on my arduino-uno board and everything worked quite fine.
now i want to build a "boxed"-version of an auduino-synth and i bougth an arduino-leonardo board. if i want to upload the source-code to the leonardo-board i get an error-message like
"auduino_v5.pde: In function 'void audioOn()':
auduino_v5:134: error: 'TCCR2A' was not declared in this scope
auduino_v5:134: error: 'COM2B1' was not declared in this scope
auduino_v5:134: error: 'WGM20' was not declared in this scope
auduino_v5:135: error: 'TCCR2B' was not declared in this scope
auduino_v5:135: error: 'CS20' was not declared in this scope
auduino_v5.pde: In function 'void TIMER2_OVF_vect()':
auduino_v5:207: error: 'OCR2B' was not declared in this scope"
its in the part of the source-code where the processor should be detected:
void audioOn() {
#if defined(AVR_ATmega8)
// ATmega8 has different registers
TCCR2 = _BV(WGM20) | _BV(COM21) | _BV(CS20);
TIMSK = _BV(TOIE2);
#elif defined(AVR_ATmega1280)
TCCR3A = _BV(COM3C1) | _BV(WGM30);
TCCR3B = _BV(CS30);
TIMSK3 = _BV(TOIE3);
#else
// Set up PWM to 31.25kHz, phase accurate
TCCR2A = _BV(COM2B1) | _BV(WGM20);
TCCR2B = _BV(CS20);
TIMSK2 = _BV(TOIE2);
#endif
}
i cant believe that the leonardo doesnt support the audio-functions that the uno does?!?
does anybody have any idea?
thanks for your help.