Hi all, I'm new here.
I'm trying to make a voltmeter using LCD 16x2 as the display.
The problem is, the backlight is showing but there's no any display at all.
My wiring is as the following:
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 5
LCD D5 pin to digital pin 4
LCD D6 pin to digital pin 3
LCD D7 pin to digital pin 2
LCD R/W pin to ground
Positive on the battery to Analog 0
Negative on the battery to GND.
(I used a 9V battery for the first attempt)
and I use this sketch
/*
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
*/
// include the library code:
#include <LiquidCrystal.h> //Fire up the library.
int val = 0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
//Prints stuff.
pinMode(A0, INPUT);
lcd.setCursor(4,0); //Col 4, Row 0
lcd.print("SBTS");
lcd.setCursor(0,1); //Col 0, Row 1
lcd.print("Volts:"); //Unit goes here.
}
void loop() {
lcd.setCursor(7,1); //Col 7, Row 1
lcd.print(analogRead(0)/204.6); //Converts arduino's 0-1023 to 0.00-5.00
delay(100);
}
help please?