Transmit pressure/temperature reading once per hour from xDot to iupivot server
Dependencies: ATParser MPL3115A2 mbed
Diff: main.cpp
- Revision:
- 0:50820e1648aa
- Child:
- 1:b672c24629d5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 03 14:44:59 2018 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "MPL3115A2.h" + +MPL3115A2 pressure_sensor(PB_7,PB_6,0x60); + +Serial pc(SERIAL_TX, SERIAL_RX, 115200); +Serial device(PA_9, PA_10, 115200); // tx, rx + +DigitalOut myled(LED1); +int main() { +//Try to connect xDot to network + while(1) { + if(pc.readable()) { + device.putc(pc.getc()); + myled = !myled; + } + if(device.readable()) { + pc.putc(device.getc()); + myled = !myled; + } + } +} \ No newline at end of file