Pages: 1 ... 9 10 [11] 12 13 ... 15   Go Down
Author Topic: Menu for Display  (Read 14933 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Oliver ;-) you are the number one :-) I will try it :-) ... and then i'll let you know :-)

from your point of view and experience ... if in a future i would like to implement another kind of display for example touch screen :-) what do you suggest to use ;-) ?

Thanks and nice week end,
Gnux
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

M2tklib has touch screen support. I did tests with U8glib, a dogm128 display and the touch screen mentioned in the data sheet of the dogm128: http://www.lcd-module.com/eng/pdf/grafik/dogm128e.pdf

In general almost no effort is required for resistive touch screens, u8glib and m2tklib, so my suggestion is to look for a graphics display, which is supported by u8glib and has a resistive touch screen.

The components from here http://www.lcd-module.com/eng/pdf/grafik/dogm128e.pdf are known to work.

Oliver

Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good Morning Oliver,
I've request a quotation ;-) for the display suggested by you :-)

this evening i'll let you know about modification that you have did to the library because I will test it ;-)

thanks you very much,
gnux
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao Oliver,
I've order the display touch indicate from you :-) after the vacation i will try install it maybe i will need more help :-) however i will beat my
head in front the situation and only after i will ask help ;-) ...

So another thing that I've in mind is do a voltmeter :-) but I would like to put the result on a graphic do you think is possible ?

http://arduinoprojects101.com/arduino-voltmeter/

my idea is put on the y the V and on the x the time for example one minute and do a line of the graphic trend but here i really don't know from start

Thansk for all your support,
regards,
Gnux
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

First: Sample the values over some time and store the values in an array:
for( i = 0; i < 100; i++ )
  array = analogRead(...)

Second: Plot the array over time
for( i = 0; i < 100; i++ )
  u8g.drawPixel(i, display_height-1-array(i));

Oliver
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good Morning Oliver, just come back from my vacation I've tried to use the new library version with the other shortcut like did for the other but seems is not working... I've tried also to change the button in case of broken but was ok ...

m2.setPin(M2_KEY_HOME2,uiKeyDevPin);
m2.setHome2(&el_num_menu);

what could i check ?

thanks
gnux
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for reporting. There was a small bug, which is fixed in the attached release.

Oliver

* m2tklib_arduino_lc_1.11pre2.zip (203.11 KB - downloaded 14 times.)
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao Oliver,
sorry for the late but I was out of home I wasn't to work :-( ...

So I've tried and now the library seems it's working ... but I've a trouble ...

so it's pass a little bit time but i try to explain you ... i'm loop I've this:

Code:
if ( m2.getRoot() == &m2_null_element )
  {
    digitalWrite(13, HIGH);
    // yes, it is our manual written screen
    // place your manual commands here
    lcd.setCursor(1, 2);
    lcd.print("*Home Sweet Home*");
    digitalClockDisplay();
    // check if the user has pressed a key while manual screen is active
   if ( m2.getKey() != M2_KEY_NONE )
    {
          digitalWrite(13, LOW);
          m2.setRoot(&top_el_expandable_menu);   // refer to a suitable menu
     }
   
  }
  // do normal menu display 
  m2.checkKey();
  if ( m2.handleKey() ) {
    m2.draw();
  }

right now I press a button i can entry into the menu ... because the condition is verified ...

I've tried to change this structure in order to when I press a shortcut button i can entry into the menu ... but without success ...I've did something like this ...

Code:
if ( m2.getKey() != M2_KEY_NONE )
    {
    if (m2.getKey() == M2_KEY_HOME2)  --> new shortcut
     {
          digitalWrite(13, LOW);
          m2.setRoot(&el_num_menu);   // refer to a suitable menu
     }
          digitalWrite(13, LOW);
          m2.setRoot(&top_el_expandable_menu);   // refer to a suitable menu
     }

but due the fact I've strange result ... could you ask kindly where I m wrong from your point of view ?

thanks
Andrea
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

getKey() will remove the event from the queue. So any other call to getKey() will return NONE or another key. You must only call getKey() once, store the result and then check for the key:
Code:
uint8_t key = m2.getKey();
if ( key != M2_KEY_NONE )
    {
    if (key == M2_KEY_HOME2)  --> new shortcut
     {
          digitalWrite(13, LOW);
          m2.setRoot(&el_num_menu);   // refer to a suitable menu
     }
          digitalWrite(13, LOW);
          m2.setRoot(&top_el_expandable_menu);   // refer to a suitable menu
     }

See the also http://code.google.com/p/m2tklib/wiki/fnref#getKey

Still amazing thread. I think you must have been used all the features of m2tklib until now...  smiley-eek

Oliver
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wonderful :-) Thanks it's working :-) i post you the code :-)

Code:
if ( key != M2_KEY_NONE )
    {
      if (key == M2_KEY_HOME2)
     {
          digitalWrite(13, LOW);
          m2.setRoot(&el_num_menu);   // refer to a suitable menu
     }
     else
      {
          digitalWrite(13, LOW);
          m2.setRoot(&top_el_expandable_menu);   // refer to a suitable menu
      } 
   }

you have reason it's a very long topic :-) but I think that if a person will need to use m2tklib i think that if will search on the forum it's a very great example how to use this library :-) ... I think this is the very real forum sense ...

Look into the forum the solution,
try, if not ok
ask
and give back the feed back, behind that i think there is respect :-)

Thanks again Oliver :-) number one without you I was lost :-) .  When will arrive the other display I'll try and I'll you know ...

When Will be finished the project I would like to a summary of this topic in order to a have a small guide :-) for me and for other that use this fantastic library

Gnux
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao Oliver,
I take the opportunity to say to you " ...    feast of the assumption :-) "

so waiting the other display I was tuning my communication inside my project. Mainly in my project I'm using your library M2TKLIB and Virtual Wire Library, well basically I've a menu from where I send out data and I wait the answer. happen sometimes that I miss the answer back and then I need to transmit back the message again. With re-transmission it's ok. but I was trying to lose less message is possible.

Removing Display and doing a simple program that transmit and receive it's everything ok. Why your great experience what could i check in order to fix the issues ?
So I've a procedure that is called on the "OK" button from the menu. Is there any pause, delay at low level into display library ?

How ever thanks for the support, i will try also by my self to discovered and fix the issues :-)

regards,
Gnux
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

m2.draw() might take some time. Not knowing virtual wire at all, maybe the following ideas might help or at least the should be checked:
1) ensure that there are no pending messages before calling m2tklib.draw(). That means you need to call m2tklib.draw() as long as vw_have_message() returns true. Read and handle messages until vw_have_message() returns false!
2) Maybe you can increase the internal message buffer. Maybe double the value of VW_RX_RAMP_LEN  from 160 to 320 (if there is enough RAM available)

Oliver
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao Oliver,

how ever thanks :-)

I will double ramp message and then I'll let you know :-)

I'll modify the value into virtual wire library and I'll let you know

thansk again
Gnux
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think i made a small typing error. I wanted to write:

1) ensure that there are no pending messages before calling m2tklib.draw(). That means you need to call vw_get_message() as long as vw_have_message() returns true. Read and handle messages until vw_have_message() returns false!

Oliver
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 433
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao Oliver,
thanks so I've tried something ... like your suggestion ... so

1) m2.draw(); is called when I push a button

Code:
m2.checkKey();
  if ( m2.handleKey() ) {
    m2.draw();
  }

then inside that I decide from a menu when send out a message, so what I doing is sendout message and then call a procedure for wait the answer

Code:
if (vw_wait_rx_max(2000))
    { 
      if (vw_get_message(buf, &buflen)) // Non-blocking
        {   
          msgrx = buf[0]; 
        }
    }

in this case I think (please correct me if i wrong) that m2.draw(); is already running

I've tried also to modify into the library the VW_RX_RAMP_LEN  from 160 to 320 i think there isn't ram issues because i didn't have error from this stand point but the devices are not synchronized ... to be honest I didn't understand the scope of VW_RX_RAMP_LEN  (ok I've understand that is a something like buffer but not exactly what is doing ...) ...

Is strange because due the fact I'm already inside the menu and inside the procedure that I call I've the TX and RX like in the example of virtual wire ...... 

Ok I've the RE-TRY transmission procedure but should be used only a extreme cases ...

If you have any suggestion ;-) I very appreciate it :-)

Thanks
Gnux
Logged

Pages: 1 ... 9 10 [11] 12 13 ... 15   Go Up
Jump to: