This is a C++ library for the Arduino IDE that helps access the on-board hardware of the Balboa 32U4 control board.
C++ Shell Emacs Lisp
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
examples Balancer.ino: Add a note about installing the LSM6 library. Mar 8, 2017
.dir-locals.el This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
.gitignore This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
.travis.yml .travis.yml: Do not modify the u option because Travis itself uses an… Mar 8, 2017
Balboa32U4.h Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
Balboa32U4Buttons.h Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
Balboa32U4Buzzer.h Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
Balboa32U4Encoders.cpp Balboa32U4Encoders: Fixed a bug that caused errors from the right enc… Jul 17, 2017
Balboa32U4Encoders.h Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
Balboa32U4LCD.h Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
Balboa32U4Motors.cpp Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
Balboa32U4Motors.h Balboa32U4Motors.h: Fixed the comments for setRightSpeed and setSpeeds. Apr 19, 2017
Doxyfile This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
FastGPIO.h This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
LICENSE.txt This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
PololuBuzzer.cpp This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
PololuBuzzer.h This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
PololuHD44780.cpp This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
PololuHD44780.h This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
Pushbutton.cpp This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
Pushbutton.h This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
README.md Updated README.md and library.properties for version 1.0.1. Jul 17, 2017
USBPause.h This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017
components.txt Updated keywords.txt. Feb 24, 2017
keywords.txt Updated keywords.txt. Feb 24, 2017
library.properties Updated README.md and library.properties for version 1.0.1. Jul 17, 2017
local_keywords.txt Changed Balboa to Romi in the library source code and local_keywords.… Feb 24, 2017
update_components.sh This is a copy of the Romi32U4 library with an updated README.md, lib… Feb 24, 2017

README.md

Balboa32U4 library

Version: 1.0.1
Release date: 2017-07-17
Build Status
www.pololu.com

Summary

This is a C++ library for the Arduino IDE that helps access the on-board hardware of the Balboa 32U4 control board, which is part of the Balboa 32U4 balancing robot. The board is based on the Arduino-compatible ATmega32U4 MCU and integrates motor drivers, encoders, buzzer, buttons, an LSM6DS33 accelerometer and gyro, and an LIS3MDL compass.

This library does not include code for accessing the LSM6DS33 or LIS3MDL. If you want to access those sensors, you should install the separate LSM6 and LIS3MDL libraries.

This library is very similar to the Romi32U4 library.

Installing the library

If you are using version 1.6.2 or later of the Arduino software (IDE), you can use the Library Manager to install this library:

  1. In the Arduino IDE, open the "Sketch" menu, select "Include Library", then "Manage Libraries...".
  2. Search for "Balboa32U4".
  3. Click the Balboa32U4 entry in the list.
  4. Click "Install".

If this does not work, you can manually install the library:

  1. Download the latest release archive from GitHub and decompress it.
  2. Rename the folder "balboa-32u4-arduino-library-master" to "Balboa32U4".
  3. Move the "Balboa32U4" folder into the "libraries" directory inside your Arduino sketchbook directory. You can view your sketchbook location by opening the "File" menu and selecting "Preferences" in the Arduino IDE. If there is not already a "libraries" folder in that location, you should make the folder yourself.
  4. After installing the library, restart the Arduino IDE.

Examples

Several example sketches are available that show how to use the library. You can access them from the Arduino IDE by opening the "File" menu, selecting "Examples", and then selecting "Balboa32U4". If you cannot find these examples, the library was probably installed incorrectly and you should retry the installation instructions above.

Classes and functions

The main classes and functions provided by the library are listed below:

  • Balboa32U4ButtonA
  • Balboa32U4ButtonB
  • Balboa32U4ButtonC
  • Balboa32U4Buzzer
  • Balboa32U4Encoders
  • Balboa32U4LCD
  • Balboa32U4Motors
  • ledRed()
  • ledGreen()
  • ledYellow()
  • usbPowerPresent()
  • readBatteryMillivolts()

Component libraries

This library also includes copies of several other Arduino libraries inside it which are used to help implement the classes and functions above.

You can use these libraries in your sketch automatically without any extra installation steps and without needing to add any extra #include lines to your sketch.

You should avoid adding extra #include lines such as #include <Pushbutton.h> because then the Arduino IDE might try to use the standalone Pushbutton library (if you previously installed it), and it would conflict with the copy of the Pushbutton code included in this library. The only #include line needed to access all features of this library are:

#include <Balboa32U4.h>

Documentation

For complete documentation, see https://pololu.github.io/balboa-32u4-arduino-library. If you are already on that page, then click on the links in the "Classes and functions" section above.

Version history

  • 1.0.1 (2017-07-17): Fixed a bug that caused errors from the right encoder to get reported as errors from the left encoder.
  • 1.0.0 (2017-03-08): Original release.