Schupp

Untitled

Apr 5th, 2021
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // this example is public domain. enjoy!
  2. // https://learn.adafruit.com/thermocouple/
  3.  
  4. #include "max6675.h"
  5. #include "BluetoothSerial.h"
  6.  
  7. #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
  8. #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
  9. #endif
  10.  
  11. BluetoothSerial SerialBT;
  12. int thermoDO = 4;
  13. int thermoCS = 16;
  14. int thermoCLK = 17;
  15.  
  16. MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
  17.  
  18. void setup() {
  19. Serial.begin(115200);
  20. SerialBT.begin("ESP32test");
  21. // wait for MAX chip to stabilize
  22. delay(500);
  23. }
  24.  
  25. void loop() {
  26. // basic readout test, just print the current temp
  27.  
  28. Serial.print(round(thermocouple.readCelsius()));
  29. Serial.println("");
  30. SerialBT.print("x:");
  31. SerialBT.println(round(thermocouple.readCelsius()));
  32. // SerialBT.println(";");
  33. // For the MAX6675 to update, you must delay AT LEAST 250ms between reads!
  34. delay(1000);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment