document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <LiquidCrystal_I2C.h>
  2. #include <Wire.h>
  3. int sensorValue=0;
  4. int umidita=0;
  5. LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
  6. void setup(){
  7. Serial.begin(9600);
  8. lcd.begin(20,4);
  9. lcd.clear();
  10. lcd.setCursor(0,0);
  11. lcd.print("umidita terreno:");
  12. }
  13.  
  14. void loop(){
  15. sensorValue = analogRead(0);
  16. umidita = map (sensorValue, 100, 970, 100, 0);
  17. lcd.setCursor(0,1);
  18. lcd.println(umidita);
  19. delay(100);
  20.  
  21. }
');