Code compiles in arduino uno but not in seeeduino xiao

Hello all,
beginner with seeeduino here, i have been trying to compile a open source code which i slightly modified.
I am able to compile the same code in arduino uno but not with seeeduino xiao. I am sure it can be solved easily , any help will be appreciated.
here is the error message from IDE:
In function ‘void loop()’:
test2_mask_seeduino:143:28: error: invalid conversion from ‘const uint8_t ()[8] {aka const unsigned char ()[8]}’ to ‘short int’ [-fpermissive]

   drawImage(mouth_smile);

                        ^

C:\Users\parth\OneDrive\Documents\Arduino\test2_mask_seeduino\test2_mask_seeduino.ino:96:6: note: initializing argument 1 of ‘void drawImage(short int)’

void drawImage(short image_addr){

  ^~~~~~~~~

test2_mask_seeduino:145:26: error: expected ‘)’ before ‘]’ token

     drawImage(mouth_0]);

                      ^

test2_mask_seeduino:147:26: error: invalid conversion from ‘const uint8_t ()[8] {aka const unsigned char ()[8]}’ to ‘short int’ [-fpermissive]

     drawImage(mouth_1);

                      ^

C:\Users\parth\OneDrive\Documents\Arduino\test2_mask_seeduino\test2_mask_seeduino.ino:96:6: note: initializing argument 1 of ‘void drawImage(short int)’

void drawImage(short image_addr){

  ^~~~~~~~~

test2_mask_seeduino:149:26: error: invalid conversion from ‘const uint8_t ()[8] {aka const unsigned char ()[8]}’ to ‘short int’ [-fpermissive]

     drawImage(mouth_2);

                      ^

C:\Users\parth\OneDrive\Documents\Arduino\test2_mask_seeduino\test2_mask_seeduino.ino:96:6: note: initializing argument 1 of ‘void drawImage(short int)’

void drawImage(short image_addr){

  ^~~~~~~~~

test2_mask_seeduino:151:26: error: invalid conversion from ‘const uint8_t ()[8] {aka const unsigned char ()[8]}’ to ‘short int’ [-fpermissive]

     drawImage(mouth_3);

                      ^

C:\Users\parth\OneDrive\Documents\Arduino\test2_mask_seeduino\test2_mask_seeduino.ino:96:6: note: initializing argument 1 of ‘void drawImage(short int)’

void drawImage(short image_addr){

  ^~~~~~~~~

test2_mask_seeduino:153:26: error: invalid conversion from ‘const uint8_t ()[8] {aka const unsigned char ()[8]}’ to ‘short int’ [-fpermissive]

     drawImage(mouth_4);

                      ^

C:\Users\parth\OneDrive\Documents\Arduino\test2_mask_seeduino\test2_mask_seeduino.ino:96:6: note: initializing argument 1 of ‘void drawImage(short int)’

void drawImage(short image_addr){

  ^~~~~~~~~

Multiple libraries were found for “Adafruit_ZeroDMA.h”

Used: C:\Users\parth\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.7\libraries\Adafruit_ZeroDMA

Not used: C:\Users\parth\OneDrive\Documents\Arduino\libraries\Adafruit_Zero_DMA_Library

exit status 1

invalid conversion from ‘const uint8_t ()[8] {aka const unsigned char ()[8]}’ to ‘short int’ [-fpermissive]
HERE is the code:

#include <Adafruit_NeoPixel.h>
#include <Adafruit_NeoMatrix.h>
#include <gamma.h>

#define lengthof(A) ((sizeof((A))/sizeof((A)[0])))
#define LED_Din 6
#define MicPin 0
#define TouchPin 3


const PROGMEM uint8_t mouth_0[8][8] = {
  
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {6,6,6,6,6,6,6,6},
    {6,6,6,6,6,6,6,6},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0}
};

const PROGMEM uint8_t mouth_4[8][8] = {
    {0,0,6,6,6,6,0,0},
    {0,6,0,0,0,0,6,0},
    {6,0,0,0,0,0,0,6},
    {6,0,0,0,0,0,0,6},
    {6,0,0,0,0,0,0,6},
    {6,0,0,0,0,0,0,6},
    {0,6,0,0,0,0,6,0},
    {0,0,6,6,6,6,0,0}
};

const PROGMEM uint8_t mouth_3[8][8] = {
    {0,0,0,0,0,0,0,0},
    {0,0,6,6,6,6,0,0},
    {0,6,0,0,0,0,6,0},
    {6,0,0,0,0,0,0,6},
    {6,0,0,0,0,0,0,6},
    {0,6,0,0,0,0,6,0},
    {0,0,6,6,6,6,0,0},
    {0,0,0,0,0,0,0,0}
};

const PROGMEM uint8_t mouth_2[8][8] = {
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,6,6,6,6,6,6,0},
    {6,0,0,0,0,0,0,6},
    {6,0,0,0,0,0,0,6},
    {0,6,6,6,6,6,6,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0}
};

const PROGMEM uint8_t mouth_1[8][8] = {
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,6,6,0,0,0},
    {6,6,6,0,0,6,6,6},
    {6,6,6,0,0,6,6,6},
    {0,0,0,6,6,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0}
};

const PROGMEM uint8_t mouth_smile[8][8] = {
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {6,0,0,0,0,0,0,6},
    {6,6,0,0,0,0,6,6},
    {0,6,6,6,6,6,6,0},
    {0,0,6,6,6,6,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0}
};

const PROGMEM uint8_t mouth_frown[8][8] = {
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,6,6,6,6,0,0},
    {0,6,6,6,6,6,6,0},
    {6,6,0,0,0,0,6,6},
    {6,0,0,0,0,0,0,6},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0}
};

uint16_t palette[8] = {};
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, 6,
  NEO_MATRIX_BOTTOM     + NEO_MATRIX_RIGHT +
  NEO_MATRIX_ROWS    + NEO_MATRIX_ZIGZAG,
  NEO_GRB            + NEO_KHZ800);


void drawImage(short image_addr){
    for(int x = 0; x<8; x++){
        for(int y = 0; y<8; y++){
            uint8_t index = pgm_read_byte(image_addr+x+y*8);
            matrix.drawPixel(x, y, palette[index]); 
        }
    }

    matrix.show();
}


void setup() {
   pinMode(LED_Din, OUTPUT);
    pinMode(MicPin, INPUT);
     pinMode(TouchPin, INPUT);

    matrix.begin();

    palette[0] = matrix.Color(0,0,0);
    palette[1] = matrix.Color(255,0,0);
    palette[2] = matrix.Color(0,255,0);
    palette[3] = matrix.Color(0,0,255);
    palette[4] = matrix.Color(0,255,255);
    palette[5] = matrix.Color(255,0,255);
    palette[6] = matrix.Color(255,255,0);
    palette[7] = matrix.Color(255,255,255);

    Serial.begin(9600);

}

float vol = 0;
const uint16_t samples = 128;

void loop() {
    float nvol = 0;
    int previous_peak = -1;
    for (int i = 0; i<samples; i++){
        int analog = analogRead(MicPin);
        int micline = abs(analog - 512);
        nvol = max(micline, nvol);
    }
    vol = (nvol + 1.0*vol)/2.0;
    Serial.println(vol);
    
     if (digitalRead(3) == HIGH){
      drawImage(mouth_smile);
     } else if(vol < 120){
        drawImage(mouth_0]);
    } else if(vol < 220){
        drawImage(mouth_1);
    } else if(vol < 320){
        drawImage(mouth_2);
    } else if(vol < 420){
        drawImage(mouth_3);
    } else {
        drawImage(mouth_4);
    }
}

Sorry, I didn’t understand your question. What code are you compiling?What products are used?What features are you going to implement?

hello zhou, sorry for not being clear enough, the code is attached in the previous post, i am making a sound sensistive led panel. i am using neopixel 8x8 led matrix, and an elektret microphone, the above code works completely fine with the arduino.
The problem is with the neopixel part of the code

Hi @Parth109, The Arduino Uno is based on 8-bit AVR architecture and Seeed XIAO based on 32 bit ARM architecture so you might need to more lines to make it compatible with the XIAO.

Did you try to run any example code on XIAO for the neopixel 8x8 matrix? and it’s working fine?

Hi Salman,
Indeed the test program from neopixel library works fine!