MKRWIFI1010 and rgb shield

I get error messages when compiling the rgb shield examples on the MKRwifi1010.
What is the problem?

You go first.

I want to show you, but how do I paste the copied messages from th IDE?

Ctrl-c and ctrl-v work for me.

E:\sync-kantoor\Arduino\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:82: error: no matching function for call to 'arduino::HardwareSPI::HardwareSPI(SERCOM*, const uint8_t&, const uint8_t&, const uint8_t&, SercomSpiTXPad, SercomRXPad)'
static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
^
In file included from C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\libraries\SPI/SPI.h:24:0,
from E:\sync-kantoor\Arduino\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:20:
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:104:7: note: candidate: constexpr arduino::HardwareSPI::HardwareSPI()
class HardwareSPI
^~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:104:7: note: candidate expects 0 arguments, 6 provided
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:104:7: note: candidate: constexpr arduino::HardwareSPI::HardwareSPI(const arduino::HardwareSPI&)
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:104:7: note: candidate expects 1 argument, 6 provided
E:\sync-kantoor\Arduino\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:17: error: cannot declare variable 'SPI_MATRIX' to be of abstract type 'arduino::HardwareSPI'
static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
^~~~~~~~~~
In file included from C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\libraries\SPI/SPI.h:24:0,
from E:\sync-kantoor\Arduino\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:20:
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:104:7: note: because the following virtual functions are pure within 'arduino::HardwareSPI':
class HardwareSPI
^~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:109:21: note: virtual uint8_t arduino::HardwareSPI::transfer(uint8_t)
virtual uint8_t transfer(uint8_t data) = 0;
^~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:110:22: note: virtual uint16_t arduino::HardwareSPI::transfer16(uint16_t)
virtual uint16_t transfer16(uint16_t data) = 0;
^~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:111:18: note: virtual void arduino::HardwareSPI::transfer(void*, size_t)
virtual void transfer(void *buf, size_t count) = 0;
^~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:114:18: note: virtual void arduino::HardwareSPI::usingInterrupt(int)
virtual void usingInterrupt(int interruptNumber) = 0;
^~~~~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:115:18: note: virtual void arduino::HardwareSPI::notUsingInterrupt(int)
virtual void notUsingInterrupt(int interruptNumber) = 0;
^~~~~~~~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:116:18: note: virtual void arduino::HardwareSPI::beginTransaction(arduino::SPISettings)
virtual void beginTransaction(SPISettings settings) = 0;
^~~~~~~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:117:18: note: virtual void arduino::HardwareSPI::endTransaction()
virtual void endTransaction(void) = 0;
^~~~~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:120:18: note: virtual void arduino::HardwareSPI::attachInterrupt()
virtual void attachInterrupt() = 0;
^~~~~~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:121:18: note: virtual void arduino::HardwareSPI::detachInterrupt()
virtual void detachInterrupt() = 0;
^~~~~~~~~~~~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:123:18: note: virtual void arduino::HardwareSPI::begin()
virtual void begin() = 0;
^~~~~
C:\Users\kantoor\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.12\cores\arduino/api/HardwareSPI.h:124:18: note: virtual void arduino::HardwareSPI::end()
virtual void end() = 0;
^~~
exit status 1
Fout bij het compileren voor board Arduino MKR WiFi 1010

or cmd c and cmd v if you are on a Mac :slight_smile:

The code is the unaltered "scroll text" example.

do you have a link?

To what? And how do I get it?


/*
  MKR RGB - Scroll Text

  This example demonstrates how to display and scroll text
  on the MKR RGB shield. It continuously scrolls the
  current millis() value on the display.

  The circuit:
  - Arduino MKR board
  - Arduino MKR RGB shield attached

  This example code is in the public domain.
*/

#include <ArduinoGraphics.h> // Arduino_MKRRGB depends on ArduinoGraphics
#include <Arduino_MKRRGB.h>

void setup() {
  // initialize the display
  MATRIX.begin();

  // set the brightness, supported values are 0 - 255
  MATRIX.brightness(10);

  // configure the text scroll speed
  MATRIX.textScrollSpeed(125);

  // display some short text without scrolling
  MATRIX.beginText(0, 0, 127, 0, 0); // X, Y, then R, G, B
  MATRIX.print("Hi");
  MATRIX.endText();

  delay(2000);
}

void loop() {
  MATRIX.beginText(0, 0); // use the same color as before
  MATRIX.print("millis=");
  MATRIX.println(millis());
  MATRIX.endText(SCROLL_LEFT); // SCROLL_LEFT parameter here to configure scrolling left

  delay(250);
}

Good day, does anyone have a clue?
Thanks in advance.

Your compiler complains about this:

MKRRGBMatrix.cpp:25:82: error: no matching function for call to 'arduino::HardwareSPI::HardwareSPI(SERCOM*, const uint8_t&, const uint8_t&, const uint8_t&, SercomSpiTXPad, SercomRXPad)'
static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);

try to edit line 25 of that file in the library (file is at E:\sync-kantoor\Arduino\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp on your disk)

and instead of

static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);

replace by

static SPIClassSAMD SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);

does it compile now?

does it work?

if it does you might want to report a bug in Github for that example.

That does the trick! Thanks very much.
I will report it.

1 Like

Great to hear

janvol's report:

Thanks!

Thanks for following up!
Have fun