Pages: 1 [2]   Go Down
Author Topic: OpenMoCo Menu Manager - completely automated menus for Arduino  (Read 15065 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm having a similar problem when compiling.  I've installed directly into the program files\arduino\libraries folder so that each individual folder is its own library. 

C:\Program Files\Arduino\libraries\OMMenuMgr/OMMenuMgr.h: In member function 'void OMMenuMgr::_eewrite(OMMenuValue*, T)':
C:\Program Files\Arduino\libraries\OMMenuMgr/OMMenuMgr.h:989: error: 'OMEEPROM' has not been declared
Logged

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

Hi all,
I have rum the sketch, but I am geeing lot of error as below.  I thing problem with the Input Button definition, Please help me.
Regards,
Harikesh

example.ino:8:23: error: OMMenuMgr.h: No such file or directory
example:44: error: 'BUTTON_FORWARD' was not declared in this scope
example:45: error: 'BUTTON_INCREASE' was not declared in this scope
example:46: error: 'BUTTON_DECREASE' was not declared in this scope
example:47: error: 'BUTTON_BACK' was not declared in this scope
example:48: error: 'BUTTON_SELECT' was not declared in this scope
example:62: error: 'MENU_SELECT_ITEM' does not name a type
example:63: error: 'MENU_SELECT_ITEM' does not name a type
example:64: error: 'MENU_SELECT_ITEM' does not name a type
example:66: error: 'MENU_SELECT_LIST' does not name a type
example:71: error: 'MENU_SELECT' does not name a type
example:76: error: 'MENU_VALUE' does not name a type
example:77: error: 'MENU_VALUE' does not name a type
example:78: error: 'MENU_VALUE' does not name a type
example:79: error: 'MENU_VALUE' does not name a type
example:80: error: 'MENU_VALUE' does not name a type
example:83: error: 'MENU_ITEM' does not name a type
example:84: error: 'MENU_ITEM' does not name a type
example:85: error: 'MENU_ITEM' does not name a type
example:86: error: 'MENU_ITEM' does not name a type
example:87: error: 'MENU_ITEM' does not name a type
example:88: error: 'MENU_ITEM' does not name a type
example:91: error: 'MENU_LIST' does not name a type
example:94: error: 'MENU_ITEM' does not name a type
example:100: error: 'OMMenuMgr' does not name a type
example.ino: In function 'void setup()':
example:110: error: 'Menu' was not declared in this scope
example.ino: In function 'void loop()':
example:119: error: 'Menu' was not declared in this scope
example.ino: In function 'void uiQwkScreen()':
example:151: error: 'Menu' was not declared in this scope
example:157: error: 'BUTTON_SELECT' was not declared in this scope
Logged

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

Hi,
.h and .cpp files needs to move to upper folder. Same way om eprome also need to move in same folder where .h and .cpp are moved.
Regards,
Harikesh
Logged

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

Hallo,
I am trying to create Menu using this library from couple of weeks. I have tryed a lot to create Sub Menu. If any one know it, please repply me, it's not given in the example also. Please please help me out.
Harikesh Patil
Logged

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

Hi.

I have tryed a lot to create Sub Menu...
You can generate the submenu by using  MENU_LIST and MENU_ITEM similarly as the root menu is done. If you  take the example included with the library and add these lines just above the line that begins with "MENU_LIST root_list..."
Code:
                  //  List of items in the submenu level
MENU_LIST submenu_list[] = { &item_bazme, &item_bakme };
                  // Submenu item
MENU_ITEM menu_submenu = { {"Submenu>>"},  ITEM_MENU,  MENU_SIZE(submenu_list),  MENU_TARGET(&submenu_list) };
Now add "&menu_submenu" to the root list below and remove "&item_bazme, &item_bakme " from the same list. You should now have a submenu with these two items.
« Last Edit: May 05, 2014, 01:36:36 pm by kallek » Logged

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

Thank you for your support.  It's working fine.
Harikesh Patil
Logged

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

Hello! First of all - thanks to developers  for nice lib for menu! I found it very handy and simple to use. But I have one major trouble - with newer gcc (I think from 4.6 or 4.7) all PROGMEM identifers must also be const. I try to solve issues with const-ing by static_cast(const_cast(...) all works on OLDER compiler.. but I cannot find right cast for const MENU_LIST const root_list[] = {...}. without second const, that make pointer to arry elements const and PROGMEM-able it all can be compiled on older compiler, and it also WORKS! But as soon as I const root_list[] there is compiling errors about wrong cast from ‘const OMMenuItem* const ()[3]’ to type ‘void’. And without const-ing it cannot compile on ewer gcc smiley-sad

HELP! PLEASE! smiley

I knew about __flash, but I prefere old-gcc compat solution and my knowelage isn't sufficient to port this lib to __flash.

Here is what I came so far
--therm_menu_const.SNIP---
float set_temp = 26.07;
float temp_delta = 0.5;

boolean missed = false;

// values to use

                    //    TYPE            MAX    MIN    TARGET
const MENU_VALUE set_temp_value = { TYPE_FLOAT_100, 125, -50 , MENU_TARGETO(&set_temp) };
const MENU_VALUE temp_delta_value = { TYPE_FLOAT_100, 2, 0.2 , MENU_TARGETO(&temp_delta) };

                //        LABEL           TYPE        LENGTH    TARGET
const MENU_ITEM item_set_tempme = { {"Set Temperature"}, ITEM_VALUE, 0, MENU_TARGET(const_cast(&set_temp_value)) };
const MENU_ITEM item_temp_deltame = { {"Set Delta"}, ITEM_VALUE, 0, MENU_TARGET(const_cast(&temp_delta_value)) };
const MENU_ITEM item_testme = { {"Exit"}, ITEM_ACTION, 0, MENU_TARGETO(uiQwkScreen) };

               //        List of items in menu level
const MENU_LIST const root_list[] = { const_cast(&item_set_tempme), const_cast(&item_temp_deltame), const_cast(&item_testme) };

              // Root item is always created last, so we can add all other items to it
const MENU_ITEM menu_root = { {"Root"}, ITEM_MENU, MENU_SIZE(root_list), MENU_TARGET(&root_list) };

OMMenuMgr Menu(const_cast(&menu_root));
--therm_menu_const.SNIP---

I add another macro

#define MENU_TARGETO(x) reinterpret_cast(x)
#define MENU_TARGET(x) static_cast(x)
Logged

Offline Offline
Full Member
***
Karma: 6
Posts: 224
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Problem 2: I do not know how to setup the u8glib picture loop. More specific: I need to draw the screen more than once. The draw callback handler for u8glib is easy. Assuming a font with char width 4 and height 8 it is this:

Code:
void uiDraw(char* p_text, int p_row, int p_col, int len) {
  u8g.setCursorPos(p_col*4, p_row*8); 
  for( int i = 0; i < len; i++ ) {
    if( c < '!' || c > '~' )
      u8g.write(' ');
    else 
      u8g.write(p_text[i]);
  }
}

However, the screen has to be updated several times. But i do not know how to do this. Controll is given to this lib with checkInput(), but i assume that this procedure also does the character output. Pseudocode for u8glib is this:
1. check keys
2. handle keys
3. several times: redraw screen
I looked into the code, but did not find how to do 3)

Any ideas?

Oliver

I don't see from the u8g docs that it needs to be drawn constantly, but instead only to be drawn when it changes.  However, if you want to re-draw constantly, then just store the draw data in global scope, and access that as it updates...

something like this:

Code:
struct {

  char text[OM_MENU_ROWS];
  int row;
  int col;
  int len;
} screenDat;

boolean screenSet = false;

...

void setup() {

  ...

  Menu.setDrawHandler(uiDraw);
  Menu.setExitHandler(uiExit);
}

void loop() {

  Menu.checkInput();

  if( screenSet )
     u8draw();

}

void uiDraw(char* p_text, int p_row, int p_col, int len) {

    // clear out buffer
  memset(screenDat.text, ' ', OM_MENU_ROWS);
  memcpy(&screenDat.text, p_text, len);

  screenDat.row = p_row;
  screenDat.col = p_col;
  screenDat.len = len;
 
  screenSet = true;

}

void uiExit() {

  screenSet = false;
}


I believe that OMMenuMgr is one of the simplest Menu Routines available right now but there is no ug8lib support or i cant realize how to do it.
Could u post your code?
Logged

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

HI, I'm really enjoying using this library however I cannot find a copy of the documentation. Can someone point me to it please.
I am looking to disable the background interrupt driven task when the menu is being used.
Thanks...
Logged

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

... I cannot find a copy of the documentation. Can someone point me to it please.
Documentation you are looking for is included in the library .cpp and .h files. The web site had a nicely formatted version of the same.
Quote
I am looking to disable the background interrupt driven task when the menu is being used.
I think there is a function "shown()" in the OMMenuMgr.cpp that returns true if menu is displayed. If you modify the included example you can try to check the status of  "Menu.shown()".
Logged

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

Hi Kallek, works fine thanks :-)
Logged

Offline Offline
Full Member
***
Karma: 6
Posts: 224
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nobody try to adapt the library with u8glib?
Logged

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

Could not find the  OpenMoCo Menu Manager - completely automated menus for Arduino  anywhere
openmoco web site is now closed and on the web site http://dynamicperception.com/software/openmoco-avr-libraries does not have the library any more can any one help with this library please
Cheers
Rod J
Logged

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

Could not find the  OpenMoCo Menu Manager - completely automated menus for Arduino  anywhere...
You can find it on the GitHub https://github.com/DynamicPerception/OMLibraries
Logged

Pages: 1 [2]   Go Up
Jump to: