All Projects → 0xPIT → Menu

0xPIT / Menu

Minimal AVR LCD Menu System in C

Labels

Projects that are alternatives of or similar to Menu

Pulsesensorstarterproject
The Best Way to Get Started with your PulseSensor and Arduino
Stars: ✭ 38 (-13.64%)
Mutual labels:  arduino
Fram mb85rc i2c
Arduino library for I2C FRAM - Fujitsu MB85RC & Cypress FM24, CY15B
Stars: ✭ 41 (-6.82%)
Mutual labels:  arduino
Esp8266 Relay
Relay control from a web page using the ESP8266 chip
Stars: ✭ 42 (-4.55%)
Mutual labels:  arduino
Iotz
compile things easy 🚀
Stars: ✭ 39 (-11.36%)
Mutual labels:  arduino
Esp8266 Rtc Memory
Code for the YouTube video
Stars: ✭ 40 (-9.09%)
Mutual labels:  arduino
Wattuino
Arduino compatible Boards and Modules based on Microchip ARM and AVR Microcontroller
Stars: ✭ 41 (-6.82%)
Mutual labels:  arduino
Darm
A desktop arm that can write and draw.
Stars: ✭ 38 (-13.64%)
Mutual labels:  arduino
Esp8266 arduino temperature nodes
Allows a NodeMCU module to be used to capture/display/serve temperature information - uses OLED display and DHT or Dallas type temp sensors
Stars: ✭ 44 (+0%)
Mutual labels:  arduino
Pixeltime
An animated weather clock that is easy to make
Stars: ✭ 41 (-6.82%)
Mutual labels:  arduino
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+20509.09%)
Mutual labels:  arduino
Esprfremote
Sketch to use an ESP mit Arduino as a RF remote for chap-ass power outlets (BH9938)
Stars: ✭ 39 (-11.36%)
Mutual labels:  arduino
Deskmate
A tiny MQTT-powered dashboard and control center.
Stars: ✭ 39 (-11.36%)
Mutual labels:  arduino
Usb Keystroke Injector
☠️ An Arduino-based USB keyboard simulator which injects keystrokes via Bluetooth protocol or predefined payloads in a SD card.
Stars: ✭ 42 (-4.55%)
Mutual labels:  arduino
Arduino Rgb Tools
A arduino library with tools for controlling an RGB-LED
Stars: ✭ 37 (-15.91%)
Mutual labels:  arduino
Esp8266
connecting the Arduino Micro to the ESP8266
Stars: ✭ 42 (-4.55%)
Mutual labels:  arduino
Hydroponic Automation
A program to monitor and control 8 variables of a hydroponic gardening system
Stars: ✭ 38 (-13.64%)
Mutual labels:  arduino
Microgranny2
Stars: ✭ 41 (-6.82%)
Mutual labels:  arduino
Arduino Nats
An Arduino / ESP8266 / Particle Photon compatible C++ library for communicating with a NATS (http://nats.io) server
Stars: ✭ 44 (+0%)
Mutual labels:  arduino
Hass Yaap
Yet another alarm (control) panel for Home Assistant.
Stars: ✭ 44 (+0%)
Mutual labels:  arduino
Arduinocore K210
Seeed code for the Kendryte K210 SoC on Arduino
Stars: ✭ 42 (-4.55%)
Mutual labels:  arduino

MicroMenu

Copyright (c) 2014 [email protected]

Simple and concise Embedded Menu System for Arduino.

Please check out the comprehensive example applications.

Note: This has been developed and tested with Arduino 1.5.x only.

Demo Videos

TODO

Feature Set

Simple API

  • Only three core methods, navigate(), invoke() and render(),
  • plus simple helpers for navigation: next(), prev(), parent() and child().

Any hardware

  • You simply implement a handler for your
    • Clickwheels, Encoders (see examples)
    • < > Buttons
  • that will call navigate() with any of the helpers as an argument, depending on direction intended (e.g. navigate(child()) or navigate(next())).

Great display flexibility

  • Usable with any display: Text LCD, Graphic LCD, Serial Port, ...
  • Any menu type: vertical or horizontal, circular, ...
    • you only need to implement one method capable of rendering a single menu item

Single callback per menu item, multiple actions

Handles all events, eg.

  • Show the menu item label
    • can also be used to display current sensor data instead of the static text label
  • Display the menu widget
    • this is where you'd implement your 'widget', the actual funcktionality associate with a menu item
  • Trigger at the menu item
    • invoked when the user selects the item again, if already active
    • useful for:
      • save
      • accept calibration data when displaying live values
      • switching between two options or functions within a single menu item
        • e.g. to configure precision and unit for numeric values in a single menu (000.0 -> 00.00 -> 0.000 mV -> V -> kV
          • so you see a live preview 00.00kW or 000.0mV
  • Before Move to Parent (or exit the menu)
    • for instance to call a save method when you exit
    • the return value determines if the user can move to the parent or not, useful to handle unsave data
  • Stores menu data in Flash, saving RAM

Installation

Clone this repository or download the current version as an archive, copy or link it to your Arduino libraries folder, e.g. ~/Documents/Arduino/libraries on a Mac, then restart the Arduino IDE.

Usage and Concept

The code base resides in it's own namespace Menu. So you need to either prefix all methods with Menu:: or add using namespace Menu; somewhere in your code. I prefer to be explicit by opting for the prefix.

1) Define menu an structure

Begin with a dummy exit menu item. With it, you can utilize all events and functions, e.g. the parent event will be invoked, allowing you to save all data when you leave the menu or even prevent to leave. Also, you can simply clear the display when the user leaves the menu. The arguments to the macro MenuItem are: Name, Label, Next, Previous, Parent, Child, Callback. If you have no child or sibling or parent, substitute with Menu::NullItem, this is a typesafe replacement for NULL

MenuItem(miExit, "", Menu::NullItem, Menu::NullItem, Menu::NullItem, miSettings, menuExit);
    MenuItem(miSettings, "Settings", miTest1, Menu::NullItem, miExit, miCalibrateLo, menuDummy);
      MenuItem(miCalibrateLo,  "Calibrate Lo", miCalibrateHi,  Menu::NullItem,       miSettings, Menu::NullItem, menuDummy);
      MenuItem(miCalibrateHi,  "Calibrate Hi", miChannel0, miCalibrateLo,  miSettings, Menu::NullItem, menuDummy);

2) Implement a callback to render a single menu item

This example is for a 4-line text LCD, usable with the LiquidCrystal library shipped with Arduino.

void renderMenuItem(const Menu::Item_t *mi, uint8_t pos) {
    lcd.setCursor(0, pos);
    lcd.print(engine->label(mi));
}

3) Handle menu events

 bool myMenuItemCallback(Menu::Action_t act) {
  switch (act) {
    case actionParent: 
      saveAll();
      return true; // return false to prevent navigation to parent
      break;
    case actionTrigger:
      adcSaveCalibrationData();
      break;
  }
}

Example Hardware Configuration

TODO: Image LCD and TFT Boards

Licensing

The MIT License (MIT)

Copyright (c) 2014 [email protected]
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].