I'm trying to dummy a trim pot as "sensor" so I can check the code for a prototype I'm building. I've hit a snag right off the bat, as I can't get the analog values to display correctly to my lcd. I'm sure I'm just missing something easy, but I'm real brand new to writing code.
The problem - the display repeats the value from the pot over and over. For example, the value 988 would be 988988988988 over all 32 characters. Thanks for the help.
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the number of interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
// Set analog pin 0 as sensor output
int sensorPin = 0;
int sensorValue = 0;
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
}
void loop() {
// read value from sensor
sensorValue = analogRead(sensorPin);
// print value to LCD
lcd.print(sensorValue);
delay(100); // wait 100ms between
// each send
}