small problems of 16X2 I2C LCD screen

hi guys,
this is my first time used I2C LCD display on arduino. After couple researches and I finally got something displayed on it but with some unknown characters (see attachment for picture). Is there anyway to fix it? One more problem. The screen is blinking (not the back-light) while it displays the number from analog input which related to the time delay function, anyway to avoid it? please help me out, thanks

here is my example codes:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27
int sensePin = 0;
int readsen = 0;
void setup()
{
Serial.begin(9600);
lcd.init();
lcd.backlight();

void loop()
{
Serial.println(analogRead(sensePin));
delay(300);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(“Read analog:”);
lcd.setCursor(12,0);
lcd.println(analogRead(sensePin));
readsen = analogRead(sensePin);
if (readsen == 1023){
lcd.setCursor(0,1);
lcd.print(" (^^) “);
}
else if (readsen == 0){
lcd.setCursor(0,1);
lcd.print(” (-O-) “);
}
else{
lcd.setCursor(0,1);
lcd.print(” (-
-) ");
}

LiquidCrystal_I2C1602V1.zip (20.9 KB)

You are using lcd.println to send data. println sends a carrage return-linefeed after your data and the lcd tries to print cr/lf after your data. the cr/lf will not set the lcd to print on the next line. You need to use lcd.setCursor(column,line).

groundfungus:
You are using lcd.println to send data. println sends a carrage return-linefeed after your data and the lcd tries to print cr/lf after your data. the cr/lf will not set the lcd to print on the next line. You need to use lcd.setCursor(column,line).

so what else I can use to instead of println? what do you mean use lcd.setCursor? thanks

just use lcd.print. The print statement won't send cr/lfa (the funny characters ). If you want to move printing to the next line you move the cursor using setCursor.

lcd.clear(); //sets printing to first line
lcd.print("some stuff"); //prints some stuff on first line
lcd.setCursor(0,1); // sets cursor to the first character position on second line

I see, thank you so much

The screen is blinking (not the back-light) ...

To fix this part you will have to avoid clearing the screen each time around the loop. Remember that you do not have to continually erase and then rewrite the parts of your message that do not change.

Don