LCD 1602 - displaying continuos data in a row

Hi everyone,

I need to fix freezer (weak cooling), so I want to put inside a dht22 senzor to monitor temperature. And I need to display on lcd (classic 16x02) a temp value, with an 1 hour frequency, but value after value in the row, and on the end of the display it must be last one everytime. Something like this:

-35 -35 -32 -31
-31 -32 -31 -30

where -30 is the last one. Some kind of loging data :smiley:

Ive tried to find how to code this, I got little experience with arduino, but cant find anything. Seems like this is quite unusual :smiley: I dont even know, for what I exactly should look in google... My english isnt good enough for that formulation :slight_smile:

Can anybody help? I sthis even possible:) Thanks

Can you write code that keeps the last 8 values in an array ?

I can write this :stuck_out_tongue:

lcd.print(DHT.temperature, 0);

it keeps showing values one after another, but in the end of the row they dissapears on right side of the display, and shows below after a while. I tried this just witch simple numbers 0, 1, 2, 3...), and bottom line begin at number "25". On the top line it begins again at number "45". Then bottom on "65" on so on...

I dont know, why so many values is missing on display, and how manipulate with the text, to keep values in array and on the display. Ive tried scrolling, but it doesnt work.

You keep the values on the display by using lcd.setCursor() to define WHERE to display the text. Be sure to print a blank space, or two, so that replacing 10 by 9 does not result in seeing 19.

I don't understand what you are trying to do with the array. If the idea is to display the last 8 values, say that.

yes, the idea is to display last 8 values. sorry for misunderstanding. "array" has a lot of meanings in my language, Im not sure what it means in this context :slight_smile:

There is an lcd example for this display that scrolls text - that might help ?

yes, the idea is to display last 8 values. sorry for misunderstanding. "array" has a lot of meanings in my language, Im not sure what it means in this context

An array, in C++, is a collection of adjacent memory locations that are all of the same type.

So, if you want to keep track of 8 temperatures
int temps[8];
and the first temperature would be stored in temps[0].

What you would do is, each time you read a new temperature, you'd store it in the next position in the array, if there is an unused position. If the array is full, you'd shift all the elements up one, and then add the new temperature at the end.