HI friends,
I have 16by2 lcd, all code works fine of displaying joystick values and one potientiometer on lcd,
just problem is that after some time all text dissappears from lcd and no output comes. It starts displaying once i click reset.
code
// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
pinMode(A0,INPUT);
pinMode(A1,INPUT);
}
void loop() {
// set the cursor to column 0, line 1
int j1x = analogRead(A1);
int j1y = analogRead(A0);
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 0);
lcd.print("J1x=");
lcd.print(j1x);
lcd.setCursor(8,0);
lcd.print("J1y=");
lcd.print(j1y);
lcd.setCursor(0,1);
lcd.print(analogRead(A2));
delay(300);
lcd.clear();
}