-
Notifications
You must be signed in to change notification settings - Fork 0
/
Max6675_Wemos_Blynk.ino
55 lines (39 loc) · 1.08 KB
/
Max6675_Wemos_Blynk.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// WEMOS D1 mini
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SPI.h>
#include <MAX6675_Thermocouple.h> //https://github.com/YuriiSalimov/MAX6675_Thermocouple
#include <Thermocouple.h>
#define SCK_PIN 3 //RX
#define CS_PIN 4 //D2
#define SO_PIN 5 //D1
Thermocouple* thermocouple;
BlynkTimer timer;
char auth[] = "---------";
char ssid[] = "------";
char pass[] = "------";
void sendSensor()
{
const double celsius = thermocouple->readCelsius();
Serial.print("Temp. = ");
Serial.println(celsius);
Blynk.virtualWrite(V4, celsius);
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
thermocouple = new MAX6675_Thermocouple(SCK_PIN, CS_PIN, SO_PIN);
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();
}