Your basic problem is based on your program structure.
lcd.display();
lcd.print("Dev 1 is ON");
lcd.noDisplay();
The first line turns the display on.
The second line writes information to the display.
The third line turns the display off.
Now after all of that what do you expect to see on the display? Hint: The display is turned off.
My advice is to get rid of all of the display on and display off instructions and see what happens.
- I've removed clear , What I can use in order to clean up the screen ? is enough Lcd.nodisplay() ?
Lcd.nodisplay() will not do what you intend because the information that was previously displayed is still stored in the LCD controller memory. As soon as you do an lcd.display() the information will reappear on the screen.
In general all you have to do is overwrite your previous message with the new one. Here is an outline:
(1) Turn the device that you are controlling (not the LCD) on.
(2) Position the cursor to where you want the message to begin.
(3) Display the message "Device is ON" (Notice that there is an extra blank space before the word "ON")
(4) Do something else
(5) Turn the device off.
(6) Position the cursor back to the same position as in (2).
(7) Display the message "Device is OFF"
Another example:
In setup()
(1) Position the cursor
(2) Display the message "Temp is: "
In loop()
(1) Measure the temperature.
(2) Position the cursor
(3) Display several 'space' characters (enough to cover up the largest possible previous temperature value)
(4) Reposition the cursor
(5) Display the temperature
(6) do something else
(7) delay if 'something else' didn't take up too much time
Don