Go Down

Topic: JHD162A - 44780 16X2 LCD Showing Giberish ! (Read 1 time) 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.

liudr


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());
    }
}

liudr

No wonder the LCD is printing random stuff. lcd.write() takes ASCII or character code. You should use lcd.print() instead.

Go Up