Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <LiquidCrystal.h>
  2. const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2, dout = 13, interval = 5000, Rtop = 20000, A = 0.001125308852122, B = 0.000234711863267, C = 0.000000085663516;
  3. LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
  4.  
  5. void setup() {
  6. // put your setup code here, to run once:
  7. digitalWrite(dout, HIGH);
  8. lcd.begin(16, 2);
  9. // Print a message to the LCD.
  10. lcd.print("hello, world!");
  11. }
  12.  
  13. void loop() {
  14. // put your main code here, to run repeatedly:
  15. lcd.setCursor(0, 1);
  16. int diff = analogRead(2);
  17. int Rbot = diff / 5 * Rtop * (1 / (1 - (diff / 5)));
  18. int temp = 1 / (A + B * log(Rbot) + C * pow(log(Rbot), 3));
  19. // print the number of seconds since reset:
  20. lcd.print(temp);
  21. delay(5000);
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement