Code works on Arduino Uno(bluno nano), but error compiling on MKR ZERO board

I am doing a light painting led strip application. Uses a SD card to store image, and print it strip by strip over an array of LEDs.

my project uses a Bluno Nano(same mcu as Uno, but with integrated BLE), and considering to move over to MKR ZERO, due to lack of memory on a Uno MCU(currently hitting 68%).

Tried to verify my code after changing the board to MKR ZERO, and got the following error.

would be grateful if anyone can assist me with this.

arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/022582714 -hardware arduino-builder/hardware -hardware arduino-builder/packages/cores -tools arduino-builder/tools -tools arduino-builder/packages/tools -built-in-libraries arduino-builder/latest -libraries /tmp/825833479/pinned -libraries /tmp/825833479/custom -fqbn arduino:samd:mkrzero -build-cache /tmp -verbose=false /tmp/825833479/NeoPixel_Painter
In file included from /tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:21:0:
/tmp/022582714/sketch/./gamma.h:19:9: error: 'const uint8_t gamma []' redeclared as different kind of symbol
gamma[] = { // Brightness ramp for LEDs
^
In file included from /home/admin/builder/arduino-builder/packages/cores/arduino/samd/cores/arduino/Arduino.h:27:0,
from /tmp/022582714/sketch/NeoPixel_Painter.ino.cpp:1:
/home/admin/builder/arduino-builder/packages/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/include/math.h:296:15: error: previous declaration of 'double gamma(double)'
extern double gamma _PARAMS((double));
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino: In function 'void setup()':
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:90:11: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
port = portOutputRegister(digitalPinToPort(LED_PIN));
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:207:3: error: 'TCCR1A' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:207:16: error: 'WGM11' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:207:21: error: '_BV' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:207:29: error: 'WGM10' was not declared in this scope
TCCR1A = _BV(WGM11) | _BV(WGM10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:208:3: error: 'TCCR1B' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:208:16: error: 'WGM13' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:208:29: error: 'WGM12' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:208:42: error: 'CS11' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:208:54: error: 'CS10' was not declared in this scope
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino: In function 'void loop()':
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:317:3: error: 'TIMSK0' was not declared in this scope
TIMSK0 = 0;
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:349:3: error: 'OCR1A' was not declared in this scope
OCR1A = (F_CPU / 64) / linesPerSec; // Timer1 interval
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:355:13: error: 'TIFR1' was not declared in this scope
while(!(TIFR1 & _BV(TOV1))); // Wait for Timer1 overflow
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:355:25: error: 'TOV1' was not declared in this scope
while(!(TIFR1 & _BV(TOV1))); // Wait for Timer1 overflow
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:355:29: error: '_BV' was not declared in this scope
while(!(TIFR1 & _BV(TOV1))); // Wait for Timer1 overflow
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:356:5: error: 'TIFR1' was not declared in this scope
TIFR1 |= _BV(TOV1); // Clear overflow bit
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:356:18: error: 'TOV1' was not declared in this scope
TIFR1 |= _BV(TOV1); // Clear overflow bit
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:356:22: error: '_BV' was not declared in this scope
TIFR1 |= _BV(TOV1); // Clear overflow bit
^
/tmp/825833479/NeoPixel_Painter/NeoPixel_Painter.ino:376:2: error: 'TIMSK0' was not declared in this scope
TIMSK0 = 1;
^
exit status 1

You are compiling an AVR specific sketch for a SAMD processor.

It will fail with various errors until you re write the sketch to suit the new hardware.

ballscrewbob:
You are compiling an AVR specific sketch for a SAMD processor.

It will fail with various errors until you re write the sketch to suit the new hardware.

Hi. Thanks for your help, but what do you mean?

my code is mostly derived from GitHub - adafruit/NeoPixel_Painter: Light painting project for Arduino Uno + NeoPixel strips

Apologies but i am not sure what other information i should provide.

I've tested and tried to verify other arduino codes from other projects and they were able to be compiled. just not this one.

Thank you again.

A quick analogy "Take this 50cc two stroke engine and fit it into the wing of a boeing 747 and make it fly"

You have AVR CPU specific code (50cc engine) and are trying to get it to work with a different CPU (boeing 747)

You are going to have to change the code to make it work.

http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf

Thats AVR

This is SAMD

Or try get windows 10 to work on a Z80 CPU take your pick.

I am a hack and slash programmer like yourself but if I need code for a specific board I either have to re-write it of find a specific example to work with.

Additionally beware that not all ADAFRUIT libs are fully up to date.
Some still contain PDE examples or have not been maintained for a while.
Its an issue that you face more often on the CREATE editor where libs are a little more tightly controlled.

ballscrewbob:
A quick analogy "Take this 50cc two stroke engine and fit it into the wing of a boeing 747 and make it fly"

You have AVR CPU specific code (50cc engine) and are trying to get it to work with a different CPU (boeing 747)

You are going to have to change the code to make it work.

http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf

Thats AVR

This is SAMD

http://www.atmel.com/Images/Atmel-42181-SAM-D21_Summary.pdf

Or try get windows 10 to work on a Z80 CPU take your pick.

I am a hack and slash programmer like yourself but if I need code for a specific board I either have to re-write it of find a specific example to work with.

ballscrewbob:
Additionally beware that not all ADAFRUIT libs are fully up to date.
Some still contain PDE examples or have not been maintained for a while.
Its an issue that you face more often on the CREATE editor where libs are a little more tightly controlled.

thanks for the explaination. so it seems its some code that isnt working with the MKR board?
isnt the job of IDE to act like an adaptor? seems i got to find out which are the problem first..

The IDE is only there to compile code.

It it had to do conversion as well it would me massive in size and slow like a snail.
Add in the fact that you can tell it to compile for NON Arduino boards (except create which does not handle non Ardi) then you add even more complexity.

It will compile almost whatever you tell it to but some CPU's use different commands to do similar things.

And remember not all boards use the same pin-out either.

If you compile first for the board it was meant for then compile for a newer architecture the error messages will point you directly at the issue.
Then you can work out what the newer command to do that is and swap that code accordingly and move on to the next error etc.