Temperature Monitoring with thingspeak (IoT)
Dependencies: HTTPClient LM75B mbed-rtos mbed
Fork of TCPSocket_HelloWorld by
main.cpp@15:bc7fc13dc5f6, 2018-02-09 (annotated)
- Committer:
- MohamadNazrin
- Date:
- Fri Feb 09 02:19:29 2018 +0000
- Revision:
- 15:bc7fc13dc5f6
- Parent:
- 11:59dcefdda506
- Child:
- 16:91200554b881
ethernet connection static and dhcp configuration; output : ping
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 0:bb128f0e952f | 1 | #include "mbed.h" |
donatien | 0:bb128f0e952f | 2 | #include "EthernetInterface.h" |
MohamadNazrin | 15:bc7fc13dc5f6 | 3 | int main() { |
MohamadNazrin | 15:bc7fc13dc5f6 | 4 | |
MohamadNazrin | 15:bc7fc13dc5f6 | 5 | static const char* mbedIp = "192.168.137.2"; //IP |
MohamadNazrin | 15:bc7fc13dc5f6 | 6 | static const char* mbedMask = "255.255.255.0"; // Mask |
MohamadNazrin | 15:bc7fc13dc5f6 | 7 | static const char* mbedGateway = "192.168.137.1"; //Gateway |
donatien | 0:bb128f0e952f | 8 | |
donatien | 0:bb128f0e952f | 9 | EthernetInterface eth; |
MohamadNazrin | 15:bc7fc13dc5f6 | 10 | // eth.init(); //Use DHCP |
MohamadNazrin | 15:bc7fc13dc5f6 | 11 | eth.init(mbedIp,mbedMask,mbedGateway); |
donatien | 0:bb128f0e952f | 12 | eth.connect(); |
emilmont | 2:e087e9b789e9 | 13 | printf("IP Address is %s\n", eth.getIPAddress()); |
MohamadNazrin | 15:bc7fc13dc5f6 | 14 | |
emilmont | 9:4757a976148d | 15 | while(1) {} |
donatien | 0:bb128f0e952f | 16 | } |