Go Down

Topic: Menu for Display (Read 17 times) previous topic - next topic

gnusso

Hi Oliver,
so now the output is like this :


Dev:[000]  E/D:000                     
01  01  01  01  13                     
01  01  01  01  13                     
Zero    ok   back                     

I think is not Bad ... what do you think ? How do you will improve this ?

Gnux

olikraus

I am not a GUI designer. If it fullfills you needs, than it should be ok  ;)

Oliver

gnusso

Hi Oliver,
I've play very well with the new function that I've learned ... so now I was working on the display time ... I don't understood why I cannot show nothing if I arrange the menu in this way...

Code: [Select]


uint8_t dt_day_disp = RTC.get(DS1307_DATE,false);
uint8_t dt_month_disp = RTC.get(DS1307_MTH,false);
uint8_t dt_year_disp = (RTC.get(DS1307_YR,false)-2000);
uint8_t dt_min_disp = RTC.get(DS1307_MIN,false);
uint8_t dt_hour_disp = RTC.get(DS1307_HR,true);

M2_LABEL(el_dt_l1_disp, "x0y2", "ddmmyy:");
M2_U8NUM(el_dt_day_disp, "x7y2c2r1", 1,31,&dt_day_disp);
M2_U8NUM(el_dt_month_disp, "x11y2c2r1", 1,12,&dt_month_disp);
M2_U8NUM(el_dt_year_disp, "x15y2c2r1", 0,99,&dt_year_disp);

M2_LABEL(el_dt_l2_disp, "x0y1", "hhmm:");
M2_U8NUM(el_dt_hour_disp,"x7y1c2r1", 0,23,&dt_hour_disp);
M2_U8NUM(el_dt_min_disp, "x11y1c2r1", 0,59,&dt_min_disp);

M2_ROOT(el_dt_ok_disp, "x0y0", "ok", &top_el_expandable_menu);



M2_LIST(num_list_date_disp) = { &el_dt_l1_disp,&el_dt_day_disp,&el_dt_month_disp,&el_dt_year_disp,
                           &el_dt_l2_disp,&el_dt_hour_disp,&el_dt_min_disp,
                           &el_dt_ok_disp
                          };
M2_XYLIST(el_list_date_disp, NULL,num_list_date_disp);



and issues is related to this:

Code: [Select]

uint8_t dt_day_disp = RTC.get(DS1307_DATE,false);
uint8_t dt_month_disp = RTC.get(DS1307_MTH,false);
uint8_t dt_year_disp = (RTC.get(DS1307_YR,false)-2000);
uint8_t dt_min_disp = RTC.get(DS1307_MIN,false);
uint8_t dt_hour_disp = RTC.get(DS1307_HR,true);


now the question that i did to my self and that I forward to you is ... ? Ok I've set a read only field ... but how can I retrieve dynamically date / time and put it on a display ... ?

so i think to have follow your suggestion maybe correct if wrong :-)

thanks 1000,
gnux

olikraus

This is explained in tutorial 8: http://code.google.com/p/m2tklib/wiki/t08
When you jump from your toplevel main menu to the date/time entry you need to call a special procedure (prepare_user_input()) which reads data from external sources and puts them into variables which are shared with m2tklib.

If you would use a list of M2_BUTTON elements as toplevel menu, then the callback procedure for the M2_BUTTON should
(A) read the data from RTC and (B) refer to the date entry menu by using setRoot() procedure.
Tutorial 8 uses M2_STRLIST instead of M2_BUTTON, but the idea is the same.

Oliver

gnusso

Good Morning Oliver,
so I will look the documentation today and how ever I will proceed with a test and I'll let you know ...

So It fantistic this library ... thanks again for your support ... without I was do nothing ... thanks

have nice week,
gnux

Go Up