Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal_I2C.h>
- #include <Wire.h>
- int sensorValue=0;
- int umidita=0;
- LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
- void setup(){
- Serial.begin(9600);
- lcd.begin(20,4);
- lcd.clear();
- lcd.setCursor(0,0);
- lcd.print("umidita terreno:");
- }
- void loop(){
- sensorValue = analogRead(0);
- umidita = map (sensorValue, 100, 970, 100, 0);
- lcd.setCursor(0,1);
- lcd.println(umidita);
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement