Go Down

Topic: JHD162A - 44780 16X2 LCD Showing Giberish ! (Read 2577 times) previous topic - next topic

co2junkie

greetings..

I tried to make LCD read the serial data via force resistive sensor, im getting the output on serial monitor, but for somereason LCD is showing giberish.

im using 9600 baud rate, do i have to change it ? or is it something else ?


Help please.

liuzengqiang

Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

co2junkie

int forcepin = A0; // force resistive sensor

#include <LiquidCrystal.h>


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
 

  lcd.begin(16, 2);

  Serial.begin(9600);
  pinMode (forcepin, INPUT);}

void loop()
{

int force = analogRead(forcepin);
delay(200);
Serial.println (force, DEC);


if (Serial.available()) {
    lcd.write(Serial.read());
    }
}

liuzengqiang

No wonder the LCD is printing random stuff. lcd.write() takes ASCII or character code. You should use lcd.print() instead.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

Go Up