Go Down

Topic: Help with basic LCD menu (Read 2 times) previous topic - next topic

liudr


liudr,
I downloaded your phi library but it was difficult to understand, its not your fault, but i have less brain power.. I really like the videos you posted about your library but its difficult to find simple examples using Analoge button and 3wire lcds...
Is their any, pls point out.


Khalid, there are two things I provide that does menus:
1) phi_prompt library and its support library. They run with most types of inputs and HD44780 LCD. The setup part is a bit hard but my new version will provide simple setup functions.
2) phi-panel serial lcd panels or backpacks. These are hardware I designed and are already set up to run some of the phi_prompt menu functions. You simply send out a plain text to these panels through serial port with a command. The panels render the menu and interacts with users then return to you what the user selects.

I was referring to solution 2 for the OP.

Khalid

both the options require custom hardware which i have to purchase with the high shipment. ^_^

dhenry

Quote
What's the best way to go about that?


It is fairly simple:

Code: [Select]

  button=read_button(button_pin); //read button on button_pin
  switch (button) {
  case 'U': //up button is pressed
     app_index = (app_index)?(app_index-1):MAX_APP; //update app_index
     break;
  case 'D': //down button is pressed
     app_index = (app_index==MAX_APP)?0:(app_index+1_; //update app_index
     break;
  default: do_something(); //illegal key press. do something / nothing
  }

  switch (app_index) {
  case 0: app0(); //run 1st application
             break;
  case 1: app1(); //run 2nd application
             break;
  ...
  }


You can start to fill the various boxes / functions. For example, if you use analog buttons, you just need to implement it in read_button(); and you can put your coolant / flowrate display in app0(); your fan speed/voltage in app1(); ...

It cannot be simpler than that, once you cut it down to logical blocks and implement those blocks one at a time.

liudr


both the options require custom hardware which i have to purchase with the high shipment. ^_^

Option one is free. just get an hd44780 display and a few buttons. If you think $6 is expensive for international shipping, FYI shipping to Australia or Europe is almost $6 plus bubble wrap and time.

SXRguyinMA


Quote
What's the best way to go about that?


It is fairly simple:

Code: [Select]

  button=read_button(button_pin); //read button on button_pin
  switch (button) {
  case 'U': //up button is pressed
     app_index = (app_index)?(app_index-1):MAX_APP; //update app_index
     break;
  case 'D': //down button is pressed
     app_index = (app_index==MAX_APP)?0:(app_index+1_; //update app_index
     break;
  default: do_something(); //illegal key press. do something / nothing
  }

  switch (app_index) {
  case 0: app0(); //run 1st application
             break;
  case 1: app1(); //run 2nd application
             break;
  ...
  }


You can start to fill the various boxes / functions. For example, if you use analog buttons, you just need to implement it in read_button(); and you can put your coolant / flowrate display in app0(); your fan speed/voltage in app1(); ...

It cannot be simpler than that, once you cut it down to logical blocks and implement those blocks one at a time.



ok so where exactly do I put my functions? do I put it in app0(xxxx);?

Go Up