Hi guys, I'm playing around with an LCD module, and I've got it working all fine, except for one little thing: when it should be displaying numbers from 1-9, it displays 10-90 rather than 01-09. What is the best way to solve this problem?
Here is my code:
[// include the library code:
#include <LiquidCrystal.h>
int des = 0;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.print("des"); // Print a message to the LCD.
Serial.begin(9600);
}
void loop() {
des = (analogRead(1)/34.14);
lcd.setCursor(0, 1);
lcd.print(des);
delay(10);
}
The hardware is all working fine, it's just the software. Also, when I start the project up, if the value of des is less than 2 digits, it reads correctly, that is, 1,2,3,4 etc. Once the value goes above 2 digits however, if des returns to a one digit number, a zero is tacked onto the back.
Thanks for your help.