Skip to content

Instantly share code, notes, and snippets.

@timmui
Created October 4, 2015 05:19
Show Gist options
  • Save timmui/9d4b617fb5b122f23be4 to your computer and use it in GitHub Desktop.
Save timmui/9d4b617fb5b122f23be4 to your computer and use it in GitHub Desktop.
#include <LiquidCrystal.h>
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int val = 0;
void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2); // start the library
lcd.setCursor(0,0);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
val = analogRead(4); // read the input pin
lcd.setCursor(0,1);
lcd.print(val);
Serial.println(val); // debug value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment