Pages: [1]   Go Down
Author Topic: JHD162A - 44780 16X2 LCD Showing Giberish !  (Read 1803 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code! Picture!
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Pages: [1]   Go Up
Jump to: