Errors when running the servo test with motor carrier

// CODE STARTS HERE AND THE ERRORS ARE AFTER IT

#include <Arduino_PMIC.h>
#include <ArduinoMotorCarrier.h>
//#include <MKRMotorCarrier.h>
//#include <MKRMotorCarrier_REV2.h>
#define INTERRUPT_PIN 6


void setup()
{
  //Serial port initialization
  Serial.begin(115200);
  //while (!Serial);

  //Establishing the communication with the Motor Carrier
  if (controller.begin())
  {
    Serial.print("Motor Carrier connected, firmware version ");
    Serial.println(controller.getFWVersion());
  }
  else
  {
    Serial.println("Couldn't connect! Is the red LED blinking? You may need to update the firmware with FWUpdater sketch");
    while (1);
  }

  // Reboot the motor controller; brings every value back to default
  Serial.println("reboot");
  controller.reboot();
  delay(500);

  M1.setDuty(0);
  M2.setDuty(0);
  M3.setDuty(0);
  M4.setDuty(0);

  if (!PMIC.enableBoostMode()) {
    Serial.println("Error enabling Boost Mode");
  }
}

void loop() {

  //Servo sweep from 0 position to 180
  for (int i = 0; i < 180; i += 1)
  {
    //Choose which of the servo connectors you want to use: servo1(default), servo2, servo3 or servo4
    servo1.setAngle(i);
    servo2.setAngle(i);
    servo3.setAngle(i);
    servo4.setAngle(i);
    Serial.print("Servos position");
    Serial.println(i);
    delay(20);
  }

  delay(200);

  //Servo sweep from 180 position to 0
  for (int i = 180; i > 0; i -= 1)
  {
    //Choose which of the servo connectors you want to use: servo1(default), servo2, servo3 or servo4
    servo1.setAngle(i);
    servo2.setAngle(i);
    servo3.setAngle(i);
    servo4.setAngle(i);
    Serial.print("Servos position: ");
    Serial.println(i);
    delay(20);
  }


  //Keep active the communication between MKR board & MKR Motor Carrier
  //Ping the SAMD11
  controller.ping();
  //wait
  delay(50);
}

// ERRORS START HERE!

Arduino: 1.8.15 (Mac OS X), Board: "Arduino NANO 33 IoT"

In file included from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/cores/arduino/WVariant.h:22,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/variants/nano_33_iot/variant.h:25,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/libraries/Wire/Wire.h:24,
                 from /Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.h:20,
                 from /Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:20:
/Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined
 #define LITTLE_ENDIAN          1
 
In file included from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/sys/types.h:67:0,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdio.h:61,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/Print.h:22,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/Stream.h:25,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/cores/arduino/api/HardwareI2C.h:22,
                 from /Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.8.11/libraries/Wire/Wire.h:23,
                 from /Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.h:20,
                 from /Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:20:
/Users/sanperez/Documents/MATLAB/SupportPackages/R2021a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/machine/endian.h:17:0: note: this is the location of the previous definition
 #define LITTLE_ENDIAN _LITTLE_ENDIAN
 
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp: In member function 'bool PMICClass::begin()':
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:70:13: error: 'PIN_USB_HOST_ENABLE' was not declared in this scope
     pinMode(PIN_USB_HOST_ENABLE, OUTPUT);
             ^~~~~~~~~~~~~~~~~~~
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:70:13: note: suggested alternative: 'REG_USB_HOST_INTFLAG'
     pinMode(PIN_USB_HOST_ENABLE, OUTPUT);
             ^~~~~~~~~~~~~~~~~~~
             REG_USB_HOST_INTFLAG
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp: In member function 'void PMICClass::end()':
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:94:13: error: 'PIN_USB_HOST_ENABLE' was not declared in this scope
     pinMode(PIN_USB_HOST_ENABLE, INPUT);
             ^~~~~~~~~~~~~~~~~~~
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:94:13: note: suggested alternative: 'REG_USB_HOST_INTFLAG'
     pinMode(PIN_USB_HOST_ENABLE, INPUT);
             ^~~~~~~~~~~~~~~~~~~
             REG_USB_HOST_INTFLAG
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp: In member function 'bool PMICClass::enableCharge()':
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:110:18: error: 'PIN_USB_HOST_ENABLE' was not declared in this scope
     digitalWrite(PIN_USB_HOST_ENABLE, LOW);
                  ^~~~~~~~~~~~~~~~~~~
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:110:18: note: suggested alternative: 'REG_USB_HOST_INTFLAG'
     digitalWrite(PIN_USB_HOST_ENABLE, LOW);
                  ^~~~~~~~~~~~~~~~~~~
                  REG_USB_HOST_INTFLAG
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp: In member function 'bool PMICClass::enableBoostMode()':
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:166:18: error: 'PIN_USB_HOST_ENABLE' was not declared in this scope
     digitalWrite(PIN_USB_HOST_ENABLE, LOW);
                  ^~~~~~~~~~~~~~~~~~~
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:166:18: note: suggested alternative: 'REG_USB_HOST_INTFLAG'
     digitalWrite(PIN_USB_HOST_ENABLE, LOW);
                  ^~~~~~~~~~~~~~~~~~~
                  REG_USB_HOST_INTFLAG
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp: In member function 'bool PMICClass::disableBoostMode()':
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:247:18: error: 'PIN_USB_HOST_ENABLE' was not declared in this scope
     digitalWrite(PIN_USB_HOST_ENABLE, HIGH);
                  ^~~~~~~~~~~~~~~~~~~
/Users/sanperez/Documents/Arduino/libraries/Arduino_BQ24195/src/BQ24195.cpp:247:18: note: suggested alternative: 'REG_USB_HOST_INTFLAG'
     digitalWrite(PIN_USB_HOST_ENABLE, HIGH);
                  ^~~~~~~~~~~~~~~~~~~
                  REG_USB_HOST_INTFLAG
exit status 1
Error compiling for board Arduino NANO 33 IoT.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

// Im getting these weird errors, can anyone help please?
// I am running the nano 33 IoT with the nano motor carrier that came with the engineering kit
// Im running off of my MacBook Pro
1 Like

Hi, @perezs
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

This will help with advice on how to present your code and problems.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Hello, @TomGeorge!

Thanks for the heads up!

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