Monitors temperature using lm75b temperature sensor and it sends the data to thingspeak using esp8266 WIFI module.
main.cpp@2:e259a0cfc9f1, 2019-04-15 (annotated)
- Committer:
- dewantkatare
- Date:
- Mon Apr 15 18:02:44 2019 +0000
- Revision:
- 2:e259a0cfc9f1
- Parent:
- 1:8ab009672555
LM75B_Sensor, FRDM k64F
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
eduvanceIoT | 0:34d3f68b920e | 1 | #include "mbed.h" |
dewantkatare | 2:e259a0cfc9f1 | 2 | #include "LM75B.h" |
dewantkatare | 2:e259a0cfc9f1 | 3 | |
eduvanceIoT | 0:34d3f68b920e | 4 | |
dewantkatare | 2:e259a0cfc9f1 | 5 | Serial pc(USBTX, USBRX); |
dewantkatare | 2:e259a0cfc9f1 | 6 | DigitalOut led1(LED1); |
dewantkatare | 2:e259a0cfc9f1 | 7 | |
dewantkatare | 2:e259a0cfc9f1 | 8 | LM75B Temp(PTE25, PTE24); //SDA, SCL, ADDRESS |
eduvanceIoT | 0:34d3f68b920e | 9 | |
dewantkatare | 2:e259a0cfc9f1 | 10 | |
dewantkatare | 2:e259a0cfc9f1 | 11 | |
dewantkatare | 2:e259a0cfc9f1 | 12 | |
eduvanceIoT | 0:34d3f68b920e | 13 | |
dewantkatare | 2:e259a0cfc9f1 | 14 | int main() |
dewantkatare | 2:e259a0cfc9f1 | 15 | { |
dewantkatare | 2:e259a0cfc9f1 | 16 | pc.baud(115200); |
dewantkatare | 2:e259a0cfc9f1 | 17 | //pc.printf("BOARD %s\r\n", board); |
eduvanceIoT | 0:34d3f68b920e | 18 | |
dewantkatare | 2:e259a0cfc9f1 | 19 | //Temp.write(0x01, 0x00); |
dewantkatare | 2:e259a0cfc9f1 | 20 | |
dewantkatare | 2:e259a0cfc9f1 | 21 | while(1) |
dewantkatare | 2:e259a0cfc9f1 | 22 | { |
dewantkatare | 2:e259a0cfc9f1 | 23 | pc.printf("The temp is: %4.2f degree Celsius\n\r", Temp.read()); |
dewantkatare | 2:e259a0cfc9f1 | 24 | led1 = !led1; |
dewantkatare | 2:e259a0cfc9f1 | 25 | wait(2); |
dewantkatare | 2:e259a0cfc9f1 | 26 | } |
eduvanceIoT | 0:34d3f68b920e | 27 | } |
dewantkatare | 2:e259a0cfc9f1 | 28 |