Arduino UNO code with PWM sound generation to XIAO (Can’t compile Seeduino Xiao)

Hi.

I’m trying to compile this code on a XIAO but I get multiple errors, can you help me fix it?

Several errors appear in the PWM sound generation lines:

Arduino:1.8.19 (Windows 7), Tarjeta:“Seeeduino XIAO, Arduino, Off”

openpipe_breakout_echanter-SEEEDUINO:441:5: error: expected constructor, destructor, or type conversion before ‘(’ token
ISR (TIMER1_COMPA_vect) {
...
‘ASSR’ was not declared in this scope
‘EXCLK’ was not declared in this scope
‘_BV’ was not declared in this scope
‘AS2’ was not declared in this scope
‘TCCR2A’ was not declared in this scope
‘WGM21’ was not declared in this scope
‘WGM20’ was not declared in this scope
‘TCCR2B’ was not declared in this scope
‘WGM22’ was not declared in this scope
‘COM2A1’ was not declared in this scope
‘COM2A0’ was not declared in this scope
‘COM2B1’ was not declared in this scope
‘COM2B0’ was not declared in this scope
‘CS12’ was not declared in this scope
‘CS11’ was not declared in this scope
‘CS10’ was not declared in this scope
‘OCR2A’ was not declared in this scope
‘TCCR1B’ was not declared in this scope
‘WGM13’ was not declared in this scope
‘WGM12’ was not declared in this scope
‘TCCR1A’ was not declared in this scope
‘WGM11’ was not declared in this scope
‘WGM10’ was not declared in this scope
‘OCR1A’ was not declared in this scope
‘TIMSK1’ was not declared in this scope
‘OCIE1A’ was not declared in this scope
‘sei’ was not declared in this scope

Can you help me to modify the final part of the code (Configure PWM for sound generation) so that it compiles in XIAO ?

This is part of a code written exclusively for an AVR Arduino. You won't get that running on an SAMD21 based board.

Is there any SAMD21 code to configure PWM for sound generation?

Hi,

Google

samd21 pwm sound generation

Google is your friend.

Tom.. :grinning: :+1: :coffee: :australia:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.