Arduino – CLCD with I2C – Variable Resistor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); // or 0x3F int varRes=A1; void setup() { lcd.init(); delay(1000); lcd.backlight(); lcd.setCursor(0,0); lcd.print("Volume value : "); } void loop() { lcd.setCursor(0,1); lcd.print(" "); // 빈칸 4개 lcd.setCursor(0,1); lcd.print(analogRead(varRes)); } |