Advertisement
safwan092

Untitled

May 11th, 2023
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. //https://randomnerdtutorials.com/arduino-k-type-thermocouple-max6675/#:~:text=A%20K%2Dtype%20thermocouple%20is,readings%20in%20the%20Serial%20Monitor.
  2. #include <Wire.h>
  3. #include <LiquidCrystal_I2C.h>
  4. #include "max6675.h"
  5. int thermoDO = 4;
  6. int thermoCS = 5;
  7. int thermoCLK = 6;
  8. MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
  9. LiquidCrystal_I2C lcd(0x27, 16, 2);
  10. void setup() {
  11. Serial.begin(9600);
  12. lcd.init();
  13. lcd.init();
  14. lcd.backlight();
  15. lcd.setCursor(0, 0);
  16. Serial.println("MAX6675 test");
  17. delay(500);
  18. }
  19. void loop() {
  20. Serial.print("C = ");
  21. Serial.println(thermocouple.readCelsius());
  22. lcd.print(thermocouple.readCelsius());
  23. //Serial.print("F = ");
  24. //Serial.println(thermocouple.readFahrenheit());
  25. delay(1000);//250mS at least between readings
  26. lcd.clear();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement