This is a C++ library for the Arduino IDE that makes it easy to create basic menus with an 8x2 character LCD, some buttons, and an optional buzzer to beep when the buttons are pressed. Adding a menu to your project with this library will require about 1k of flash.
PololuMenu<typeof(lcd)> menu;
void setup()
{
static const PololuMenuItem items[] = {
{ F("Item one"), myFunction1 },
{ F("Item two"), myFunction2 },
};
menu.setItems(items, 2);
menu.setDisplay(lcd);
menu.setBuzzer(buzzer);
menu.setPreviousButton(buttonA, 'A');
menu.setSelectButton(buttonB, 'B');
menu.setNextButton(buttonC, 'C');
}
void loop()
{
menu.select();
}
This library depends on the PololuBuzzer, and Pushbutton libraries; it should work on other Arduino platforms that can support these libraries. For the Zumo, Balboa, and A-Star 32U4 platforms, these libraries are included within the corresponding library for the platform and should not be installed separately.
You will need one of the following display libraries:
- 2.0.0 (2021-08-02): Support multiple types of displays using templating; see the examples for how to use the template. Note that you will also need to change
PololuMenu::Item
toPololuMenuItem
. - 1.0.2 (2020-12-03): Added CI testing for GitHub; adapt examples for CI
- 1.0.1 (2020-12-01): Added
const
specification tosetSecondLine()
andsetItems()
; CI testing. - 1.0.0 (2020-11-24): Initial release.