Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- LiquidCrystal_I2C lcd(0x27,16,2);
- const int sensor = A2;
- void setup() {
- // put your setup code here, to run once:
- lcd.init();
- lcd.backlight();
- lcd.setCursor(0,0);
- lcd.print("Initialize");
- }
- void loop() {
- if(analogRead(sensor) > 250){
- lcd.clear();
- lcd.print("ERRORRRR");
- }
- else{
- double sensorValue = analogRead(sensor) * 0.05;
- lcd.clear();
- lcd.print(sensorValue);
- }
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment