| 123456789101112131415161718192021222324 |
- #include <LiquidCrystal.h>
- #include <LcdBarGraphX.h>
- byte lcdNumCols = 16; // -- number of columns in the LCD
- byte sensorPin = 0; // -- value for this example
- LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // -- creating LCD instance
- LcdBarGraphX lbg(&lcd, lcdNumCols); // -- creating
- void setup(){
- // -- initializing the LCD
- lcd.begin(2, lcdNumCols);
- lcd.clear();
- // -- do some delay: some time I've got broken visualization
- delay(100);
- }
- void loop()
- {
- // -- draw bar graph from the analog value readed
- lbg.drawValue( analogRead(sensorPin), 1024);
- // -- do some delay: frequent draw may cause broken visualization
- delay(100);
- }
|