Sending a variable to an LCD4884

I am very new to Arduino and am having problems sending variables to an LCD4884 display. I have read much on this but still cannot make it function. The following snippets are from a sketch I have written in v.0.22 with an Ethernet Shield and an LCD4884 attached to a Duemilanova…

byte dht_dat[4];//Array to hold the bytes sent from sensor.    

//printing it out...
 Serial.println("Back Room "); 
      client.print("<h2>Back Room<h2>");
      Serial.print("Humidity   : "); 
      client.print("<h3>Humidity: ");
      client.print(dht_dat[0], DEC);
      Serial.print(dht_dat[0], DEC);
      client.print(dht_dat[1], DEC);
      Serial.print(dht_dat[1], DEC);
      client.print("%  ");
      Serial.print("%  \n");

This works pefectly well and gives me the expected output on both the Serial Monitor and on my Web Page. However when I try to print the actual reading to the LCD4884 using the following statements I get nothing or randomn pixels.

 lcd.LCD_write_string(MENU_X, MENU_Y, dht_dat[0],MENU_NORMAL);

The Wiki article suggests using itoa, but when I use the following code I always get a ‘0’

 int counter = dht_dat[0]; 
 char string[10]; 
     lcd.LCD_write_string(MENU_X, MENU_Y + 1, string, MENU_NORMAL);

I can’t help but feel I am missing somthing staggeringly basic. Any assistance would be gratefully acepted.

I can't help but feel I am missing somthing staggeringly basic.

Me, too. But, without seeing all of your code, we'd just be whistling in the dark, and I don't think that would help you much.

If the code is large, then use the option under Additional Options... below the text entry box to add the file as an attachment.

Or, even better, create a small sketch that illustrates the problem and post that.

Hi PaulS, thank you for offering to end my frustration. I have attached sketch with Additional Options as per your suggestion above. I’ve done this twice now as in my initial excitement I sent you the wrong version. This version doesn’t have the Ethernet shield attached (so there is no web output component) and Serial Monitor output has been removed

In the sketch I just cannot get tens //////// int tens = dht_dat[0]; to take the value of dht_dat[0] and apply it to the following line (no matter what I use int/byte/char.

The itoa function always returns a ‘0’ no matter which member of the dht_dat array is referenced (other sketches show positive and realistic values from the Serial Monitor and Webpage.

Any help you can afford is most welcome.

LCD4884_menu_DHT_1.pde (12.3 KB)

for (i=1; i<NUM_MENU_ITEM; i++){

You’ve got four menu items, but only display the last three - is that deliberate?

When you discovered this problem, you wrote a tiny sketch, using only serial prints to isolate and investigate this problem with known values - where’s that sketch?

Sorry - working sketch attached…

dht11WebServer.pde (9.14 KB)

In regard to "You've got four menu items, but only display the last three - is that deliberate?"

I get all four menu items on the LCD4884 - they are all the defaults from the original demo sketch. I have only altered the first of the menu items (to display "TEMP/HUMIDITY" Line57) and when that menu item is selected (to display "temphumidity" Line 195).

Have posted (previous reply) the working sketch which just presents a Web Page from the Ethernet Shield and the same output to the Serial Monitor. Both these work admirably.

Came across this post, which describes the problem I'm having... but it stops short of the solution...?

Am I correct in understanding that one cannot send a variable to the LCD4484? It has to be done with a specific routine....?