Example code of sakura.io Evaluation board.
Dependencies: AQM0802A BME280 MPU9250_SPI SakuraIO gps mbed
SakuraIo Evaluation Board Standard
Overview
This program is example code of sakura.io Evaluation board.
Functions
- Periodic measure from onboard sensors(period is 200ms)
- Motion sensor(gyro, accelometer, magnetometer)
- Environment sensor(temperatur, humidity, airpressur)
- GPS(longitude, latitude, timestamp)
- Periodic send the measuring datas to sakura.io platform(period is 300sec)
- Output the measured datas output to USB-Serial port
- baudrate is 9600bps
- Can select on / off of periodic running with switch `SW5`
Description
See the Getting Started page.
Diff: main.cpp
- Revision:
- 8:b7ad0fe7ce64
- Parent:
- 5:e92264bc120e
--- a/main.cpp Mon Jul 30 13:39:33 2018 +0900 +++ b/main.cpp Tue Aug 07 12:18:37 2018 +0900 @@ -198,19 +198,15 @@ gps_decoder.get_year(), gps_decoder.get_month(), gps_decoder.get_day(), gps_decoder.get_hour(), gps_decoder.get_min(), gps_decoder.get_sec()); pc.printf("\tUNIX time: %d\r\n", gps_decoder.get_unixtime()); - if ((sakuraio.getConnectionStatus() & 0x80) == 0x80) { - led_2 = 1; - pc.printf("Send:%d\r\n", cnt_send); - lcd.setCursor(0, 1); - lcd.printf("%d", cnt_send); - enqueue_sensor_data(cnt_send); - sakuraio.send(); - cnt_send++; - led_2 = 0; - pc.printf("After %d sec to send.\r\n", (int)(SEND_INTERVAL_TICKS_PAR_COUNT * 0.2)); - } else { - return; - } + led_2 = 1; + pc.printf("Send:%d\r\n", cnt_send); + lcd.setCursor(0, 1); + lcd.printf("%d", cnt_send); + enqueue_sensor_data(cnt_send); + sakuraio.send(); + cnt_send++; + led_2 = 0; + pc.printf("After %d sec to send.\r\n", (int)(SEND_INTERVAL_TICKS_PAR_COUNT * 0.2)); } } led_1 = !led_1;