After some extensive work and revision from my original phi-menu idea (several K lines of code and 25 pages doc), I have been able to release the following two libraries to the public:Phi_prompt
: a library UI (user interface) functions for character LCD and push buttons. It should be easy to adapt to dot matrix LCD and keypads if necessary. If enough interests are shown from users, I can consider buying a keypad and do some footwork.
The library provides three essential functions with support functions that you can use as well:input_integer
asks the user to enter an integer with lower and upper bounds, step size, location to display the number and wraps around if you go beyond upper bound. See line 3 and 4 on the image.select_list
asks the user to select an item from a list, which is stored in PROGMEM. There are many rendering options such as 2 by 2 (line 5 and 6 on image), or classic list with index (line 1 and 2 o image, AKA an nice menu).
select_list is versatile enough and is often used to render menu of infinite levels. You can also use a list of YES and NOW, or HIGH and LOW or MON, TUE, ... for your input.input_panel
asks the user to enter arbitrary characters between lower and upper. You can decide to restrict to 0-9, A-A, a-z, or any range of characters, with the option to include 0-9 in the range such as the example on line 7 and 8 on image. Any characters not included in the range will not change as a convenience feature (such as the dot in the file name will not change since my input range was set to 0-9 and A-Z).
Other functions include wait_on_escape, a functions that polls all buttons for any key press, msg_lcd, a function that renders PROGMEM strings on lcd, or else.
Here is the blog post, which includes the source code release (20110327), three simple examples and one extensive example with a two-level menu, pretending itself as an interactive data logger.http://liudr.wordpress.com/libraries/phi_prompt/Next, the phi_buttons class library:
This is a simple button library with all the simple features with a twist, there are two virtual buttons, auto button, that automatically presses at a defined frequency (for automatically scrolling through a list or number), and a null button, which acts as nothing, a feature that eases program changes. If you have used 6 buttons in one project and want to save two buttons for a new project, you just define the two buttons as null buttons and don't have to dig into your codes and delete everywhere you see those two buttons.
Here is the blog post, which includes the source code release (20110327), some code snippets and one example, which reports the button pressed to serial port.http://liudr.wordpress.com/libraries/phi_buttons/