Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <Wire.h>
  2. #include <LiquidCrystal_I2C.h>
  3.  
  4. int sensorValue = 0;
  5. int Sensor = 0;
  6.  
  7. LiquidCrystal_I2C lcd(0x27, 20, 4);
  8.  
  9. void setup()
  10. {
  11. lcd.init();
  12. lcd.backlight();
  13. Serial.begin(9600);
  14. }
  15.  
  16. void loop()
  17. {
  18. // sensorValue = analogRead(A0);
  19. // Serial.println(sensorValue);
  20. /**
  21. map(value, fromLow, fromHigh, toLow, toHigh);
  22. */
  23. Sensor = map(analogRead(A0), 0, 1023, 0, 100);
  24. delay(600);
  25. lcd.clear();
  26. lcd.setCursor(5, 0);
  27. lcd.print(Sensor);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement