Skip to content

Library to help interface with the on-board hardware of the Romi 32U4 Control Board

License

Notifications You must be signed in to change notification settings

pololu/romi-32u4-arduino-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Romi32U4 library

www.pololu.com

Summary

This is a C++ library for the Arduino IDE that helps access the on-board hardware of the Romi 32U4 Control Board.

The Romi 32U4 Control Board turns the Romi chassis into a programmable, Arduino-compatible robot. It has an integrated AVR ATmega32U4 microcontroller, motor drivers, encoders, buzzer, buttons, and an LSM6DS33 accelerometer and gyro.

This library does not include code for accessing the LSM6DS33. If you want to access it, you should install the separate LSM6 library.

This library is very similar to the Zumo32U4 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 "Romi32U4".
  3. Click the Romi32U4 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 "romi-32u4-arduino-library-master" to "Romi32U4".
  3. Move the "Romi32U4" 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 "Romi32U4". 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:

  • Romi32U4ButtonA
  • Romi32U4ButtonB
  • Romi32U4ButtonC
  • Romi32U4Buzzer
  • Romi32U4Encoders
  • Romi32U4LCD
  • Romi32U4Motors
  • 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 <Romi32U4.h>

Documentation

For complete documentation, see https://pololu.github.io/romi-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.3 (2022-09-06): Fixed a bug in the Encoders demo that could prevent encoder errors from being shown properly on the display.
  • 1.0.2 (2017-07-17): Fixed a bug that caused errors for the right encoder to be reported as errors for the left encoder.
  • 1.0.1 (2017-02-23):
    • Changed the internal Romi32U4Motors::maxSpeed variable to be an int16_t so it can be compared to other int16_t variables without warnings.
    • Fixed the InterialSensors and Demo examples to not use a compass.
    • Fixed some comments.
  • 1.0.0 (2017-02-06): Original release.

About

Library to help interface with the on-board hardware of the Romi 32U4 Control Board

Resources

License

Stars

Watchers

Forks

Packages

No packages published