Code supports writing to the SD card as well as working with the Volckens group smartphone apps for the mbed HRM1017
Dependencies: ADS1115 BLE_API BME280 Calibration CronoDot EEPROM LSM303 MCP40D17 NCP5623BMUTBG SDFileSystem SI1145 STC3100 mbed nRF51822
Fork of UPAS_BLE_and_USB by
Revision 82:e01326a63ae9, committed 2015-09-16
- Comitter:
- caseyquinn
- Date:
- Wed Sep 16 00:11:34 2015 +0000
- Parent:
- 81:480f0310ef9a
- Child:
- 83:9153d6c3af81
- Commit message:
- Made some minor adjustments to the demo mode loop and now when in UBCUO mode the UPAS doesn't shut down after exiting the menu.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Sep 15 23:09:41 2015 +0000 +++ b/main.cpp Wed Sep 16 00:11:34 2015 +0000 @@ -257,7 +257,10 @@ // RunReady = 0; //} uint8_t temp_crr = Menu.crr; - if(Menu.crr == 2){ // if in Demo mode allow 1 second for each menu to change out of demo mode + if(Menu.crr == 1){ // if in Demo mode allow 1 second for each menu to change out of demo mode + RGB_LED.set_led(1,1,1); + wait(5); + RGB_LED.set_led(1,1,0); Menu.Start(pc, E2PROM, RTC, logInerval, refreshtime, volflowSet, device_name, dutyUp, dutyDown, home_lat, home_lon, work_lat, work_lon, Menu.menu_ops, 2, serial_num, calibrations); //Forces you to open the menu bleMenu.open_menu(txPayload, rxCharacteristic, E2PROM, RTC, logInerval, refreshtime, volflowSet, device_name, dutyUp, dutyDown, home_lat, home_lon, work_lat, work_lon, Menu.menu_ops ,RunReady, 3, serial_num, calibrations); }else if(RunReady == 0) { @@ -269,12 +272,13 @@ RGB_LED.set_led(0,10,10); // error code/color bleMenu.open_menu(txPayload, rxCharacteristic, E2PROM, RTC, logInerval, refreshtime, volflowSet, device_name, dutyUp, dutyDown, home_lat, home_lon, work_lat, work_lon, Menu.menu_ops ,RunReady, 0.25, serial_num, calibrations); } - if(Menu.crr == 0){ + if(Menu.menu_ops == 513 && Menu.crr == 0){ Menu.save_menu(E2PROM, logInerval, refreshtime, volflowSet, device_name, dutyUp, dutyDown, home_lat, home_lon, work_lat, work_lon, RunReady, serial_num); //Save all data to the EEPROM pbKill = 0; } } +// Add in compare function for 519(UBCUO) mode to have it wait for the start time to start RunReady = 0; if(bleMenu.crr != temp_crr){ Menu.crr = bleMenu.crr; // if this was changed in the UBM move it to the primary USM before saving @@ -282,7 +286,7 @@ Menu.save_menu(E2PROM, logInerval, refreshtime, volflowSet, device_name, dutyUp, dutyDown, home_lat, home_lon, work_lat, work_lon, RunReady, serial_num); //Save all data to the EEPROM calibrations.initialize(serial_num); - if(!Menu.crr == 2){ // don't shut off when in demo mode + if(!Menu.crr == 1){ // don't shut off when in demo mode stop.attach(&check_stop, 60); // check if we should shut down every 5 seconds, starting 60s after the start. }