Pages: [1]   Go Down
Author Topic: Phi_prompt and Phi_buttons released - interaction with LCD and buttons  (Read 2604 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
« Last Edit: March 27, 2011, 11:58:06 pm by liudr » Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Videos are up:



playlist:

http://www.youtube.com/view_play_list?p=B983E9145E4348FA
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Dr. Liu,

thanks a lot for your Phi-Prompt library, it works like a charm!

I adapted it to use the NewSoftSerial.h library instead of LiquidCrystal, because my display uses a serial connection. It's really just a hack (and not the prettiest) but if you are interested I'd of course share my findings! (which I'll propably do anyway to help other users)

Keep up the great work,
Keija

(I hope it's okay, that i used this Thread, otherwise - let me know!)
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Keija,

You are very welcome! I am considering setting up a google code page for this project and your variation is definitely welcome as part of the code repository. Please let me know when you release the code. Since I will be releasing a new version of the library (calling conventions are unchanged but more functions are added), it would be very helpful to describe what you did to modify my original code to work on a serial LCD when you release your codes.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Liu,

great! I think i should be able to put it up tomorrow - as i said it's very much of a hack at the moment, but i'll try to modify it in a way, that you'll only need to change the liquid chrystal library and only make minor changes to the rest ( as an example: at the moment you'd have to replace lcd->clear(); with clear(); everywhere it occurs).

I'll prepare a rough Tutorial for tomorrow and will try to improve it - I already have a few ideas smiley
Keija
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Great! The more clear you hack it the easier other can use this hack. It will be listed as one of the standard hacks smiley the other being shift register driven LCD hack falconfour did a while back.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Liu,

I've created a walk through of all the steps necessary and added it as a .pdf to this post. As mentioned in the Document, i'll try to avoid steps 2 and 3 by programming a wrapper class, but i haven't found time to do this. If you have any suggestions, or tutorials i'd be thankful smiley

thanks again for your phi_prompt library.

greetings,
Keija


edit:
I just noticed, that the file is not available, if you're not a registered member - I will upload it to a different server, to make it available to everyone smiley

* Modify_Phi_prompt_NewSoftSerial.pdf (18.25 KB - downloaded 9 times.)
« Last Edit: September 09, 2011, 12:09:00 pm by keija » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome! I will download this to my folder and keep it as a standard hack. Now just have to prep for optics lecture in one hour. I'll scare some students with new concepts this time.
Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK. I've put my phi_prompt library on google code. Stilling learning how to use google code.

http://code.google.com/p/phi-prompt-user-interface-library/
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Liu,

thanks for featuring me smiley I Hope your students made it through the lesson smiley-wink

Keep up the good work,
Keija
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I recently updated the instructions to reflect the changes brought by arduino 1.0
The pdf now features Instructions for Arduino 0022 and Arduino 1.0 smiley

Keija

* Modify_Phi_prompt_SoftwareSerial.pdf (212.29 KB - downloaded 7 times.)
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Keija!

Just posted on the google code page! I'll have to try out arduino 1.0 myself and enjoy the hack.
Logged


Pages: [1]   Go Up
Jump to: