Unable to build for MKRIotCarrier and MKR GSM 1400

Hello,

i am new in the arduino world - not in microcontroller in general.

Pre condition:

  • I bought the MKR Iot Carrier Rev2 and MKR GSM 1400 Boards
  • I have installed the Arduino IDE 2.0.4 under Arch Linux
  • I have installed the compiler / libraries for MKR GSM 1400
  • I have installed the Arduino_MKRIoTCarrier 2.0.1 library version

I have tried the simple Blink example. It compiles (verify) and i can flash it to the controller board. What I find strange is that nothing flashes.

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}

Now i've tried the LED_Blink example of the MKR Iot. Here i get build errors. Any ideas what i need to include to get the defines? MKR Iot not compatible? I thought it is the case.

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;

#define NUMPIXELS 5

void setup() {
  carrier.noCase();
  carrier.begin();
}

// Runs 10 LEDs at a time along strip, cycling through red, green and blue.
// This requires about 200 mA for all the 'on' pixels + 1 mA per 'off' pixel.

int      head  = 0, tail = -4; // Index of first 'on' and 'off' pixels
uint32_t color = 0xFF0000;      // 'On' color (starts red)

void loop() {

  carrier.leds.setPixelColor(head, color); // 'On' pixel at head
  carrier.leds.setPixelColor(tail, 0);     // 'Off' pixel at tail
  carrier.leds.show();                     // Refresh strip
  delay(20);                        // Pause 20 milliseconds (~50 FPS)


  if (++head >= NUMPIXELS) {        // Increment head index.  Off end of strip?
    head = 0;                       //  Yes, reset head index to start
    if ((color >>= 8) == 0)         //  Next color (R->G->B) ... past blue now?
      color = 0xFF0000;             //   Yes, reset to red
  }
  if (++tail >= NUMPIXELS) tail = 0; // Increment, reset tail index
}
/home/dev/Arduino/libraries/Arduino_MKRIoTCarrier/src/Arduino_MKRIoTCarrier.cpp: In member function 'int MKRIoTCarrier::begin()':
/home/dev/Arduino/libraries/Arduino_MKRIoTCarrier/src/Arduino_MKRIoTCarrier.cpp:34:11: error: 'AREF_PIN' was not declared in this scope
   pinMode(AREF_PIN,INPUT_PULLUP);
           ^~~~~~~~
/home/dev/Arduino/libraries/Arduino_MKRIoTCarrier/src/Arduino_MKRIoTCarrier.cpp:34:11: note: suggested alternative: 'SCK_PIN'
   pinMode(AREF_PIN,INPUT_PULLUP);
           ^~~~~~~~
           SCK_PIN

exit status 1

Compilation error: exit status 1

It seems the code from the Arduino people isn't yet prepared for any other board than the MKR WiFi 1010:

#ifdef ARDUINO_SAMD_MKRWIFI1010
#define AREF_PIN 25
#endif

That in MKRIoTCarrierDefines.h. As the MKR1400 uses the same processor pin for this functionality it's probably fine to just remove the #ifdef and #endif lines from this definition.

That should blink the yellow LED on the MKR 1400 (1 second on, 1 second off). If it doesn't, try again without the IoT Carrier connected. Does it work then?

Hi pylon,

everything works fine now.

MKRIotCarrier:
That work by comment the define lines. Some of the examples does not work, but i was able to check the functionality of the board. Perfect. Now i can start with my own stuff.

MKR 1400:
By disconnecting the board it worked also.

THX! :slight_smile:

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