Pololu Zumo 32u4 Motor Commands

[code]#include <Zumo32U4.h>

Zumo32U4Motors motors; //In order for motors.setLeftSpeed to work this line has to be added
void setup() {
// put your setup code here, to run once:
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:

motors.setLeftSpeed(50);

}[/code]

This is the error message I now get:

Arduino: 1.6.6 (Windows 7), Board: “Arduino Robot Control”

C:\Users\GunnarM\Documents\Arduino\libraries\Zumo32U4\Zumo32U4ProximitySensors.cpp: In function ‘bool digitalReadSafe(uint8_t, bool)’:

C:\Users\GunnarM\Documents\Arduino\libraries\Zumo32U4\Zumo32U4ProximitySensors.cpp:14:15: error: ‘NUM_DIGITAL_PINS’ was not declared in this scope

 if (pin < NUM_DIGITAL_PINS)

           ^

C:\Users\GunnarM\Documents\Arduino\libraries\Zumo32U4\Zumo32U4ProximitySensors.cpp: In function ‘void pinModeSafe(uint8_t, uint8_t)’:

C:\Users\GunnarM\Documents\Arduino\libraries\Zumo32U4\Zumo32U4ProximitySensors.cpp:26:15: error: ‘NUM_DIGITAL_PINS’ was not declared in this scope

 if (pin < NUM_DIGITAL_PINS)

           ^

C:\Users\GunnarM\Documents\Arduino\libraries\Zumo32U4\Zumo32U4ProximitySensors.cpp: In member function ‘void Zumo32U4ProximitySensors::lineSensorEmittersOff()’:

C:\Users\GunnarM\Documents\Arduino\libraries\Zumo32U4\Zumo32U4ProximitySensors.cpp:117:32: error: ‘NUM_DIGITAL_PINS’ was not declared in this scope

 if (lineSensorEmitterPin < NUM_DIGITAL_PINS)

                            ^

exit status 1
Error compiling.

I feel there is something missing regarding the pins and that is why it won’t run however can’t find anything that will specify which pin to run the command on. Based on the error message it feels like I have to declare the number of pins and the pin location but I am unable to figure out how.

Hello.

NUM_DIGITAL_PINS is defined in the pins_arduino.h file, which contains pin mapping information of an Arduino board. You should not have to define that when using our libraries for the Zumo 32U4.

I tested your code using Arduino 1.6.6 (on Windows 8.1), and it compiled without any errors. It is possible that your Arduino IDE could have been corrupted during the install. You might try re-installing it to see if the problem persists. Alternatively, you might try upgrading to a newer version (1.6.7) and to see if that fixes the issue, since we have heard of others having trouble using Arduino 1.6.6.

By the way, from your post, I noticed you selected the “Arduino Robot Control” board instead of “Pololu A-Star 32U4”. If you do not see the “Pololu A-Star 32U4” board listed under Tools->Board menu, you probably did not install the Zumo 32U4 drivers correctly (or not at all). I recommend reading the “Programming the Zumo 32U4” section in the Zumo 32U4 user’s guide carefully and verifying that the drivers are installed correctly. You might try compiling one of the example programs for the Zumo 32U4 for verification.

- Amanda