buttonMonitor() not declared

Product — pololu.com/product/3115
Downloaded and installed — github.com/pololu/a-star-32u4-arduino-library

Using Arduino IDE (Version 1.6.6), tried to upload PrimeDemo sketch from Examples --> AStar32U4 --> PrimeDemo,

  1. Received error about missing <Keyboard.h>, added #include <Keyboard.h> in this sketch, this issue resolved.
  2. Received the following error —
    PrimeDemo:106: error: ‘buttonMonitor’ was not declared in this scope
    switch(buttonMonitor())

I couldn’t find where buttonMonitor() is located. What do I need to do to fix this?
Thanks.

Hello.

I am glad that you fixed the issue with missing the Keyboard.h library in the PrimeDemo example code; thank you for letting us know.

As for your second issue, you contacted us directly about this as well, and I already responded, but I wanted to post the answer here for others to see as well.

The buttonMonitor is a function in the “Demo” example sketch, which is located near the bottom. I was able to reproduce the problem using Arduino 1.6.6. It looks like there might be a bug with that version where function prototypes in the sketch are not always properly generated. For now, you can work around the issue by adding the function prototype yourself. Just add this line near the top of the sketch:

char buttonMonitor();

- Amanda

Thanks. I added char buttonMonitor(); as instructed, and the issue is resolved. Sorry I missed the char buttonMonitor() function location.

By the way, I didn’t contact Pololu directly about this. I bought this product about a week ago. Maybe I missed something? Anyway, thank you for answering my question and posting it on the forum.

FYI: The buttonMonitor issue also exists in the “Demo” sketch for Zumo32U4. Your instruction resolves the issue as well. Thanks.

Now I do have a similar problem: PrimeDemo is referring to Keyboard.h that is not included in the library. Any suggestions on how to fix it ? (having A-Star 32U4 Prime SV and Arduino IDE 1.6.9)

Correction: had a wrong device selection. Seems to work now, though I still can not find keyboard.h in github

Hello.

Keyboard.h is part of the core libraries for Arduino; it is not a library we provide. You can find that file under the “libaries” folder of your Arduino IDE’s installation directory (e.g. Windows - C:\Program Files (x86)\Arduino\libraries\Keyboard).

- Amanda