Pilot 1 working code (excluding new patient after calculation). %d changed in %f sensordata serial log.
Dependencies: ADS1015 MPU6050 PixelArray mbed
Fork of Momo_New by
Diff: Sensorplate/main.cpp
- Revision:
- 9:514a44bf510f
- Parent:
- 8:bf0f7a6fb1fd
- Child:
- 10:6b3034ec3c47
--- a/Sensorplate/main.cpp Wed Sep 27 14:45:18 2017 +0000 +++ b/Sensorplate/main.cpp Wed Sep 27 15:05:02 2017 +0000 @@ -349,55 +349,65 @@ pi.printf(">03\n"); reposition_flag = 0; } - - /*if () { - pi.printf("#1\n"); - power_plug_flag_current = 1; - } - - if () { - pi.printf("#0\n"); - power_plug_logged = 1; - } else { - - } if (batteryvoltage_current != batteryvoltage_last) { pi.printf("%%d\n", batteryvoltage_current); - } else { - + } + + if (LED_red_logged != LED_red_state) { + if (LED_red_state == 1) { + pi.printf("&04\n"); + LED_red_logged = LED_red_state; + } + if (LED_red_state == 0) { + pi.printf("&40\n"); + LED_red_logged = LED_red_state; + } } - - if () { - pi.printf("&04\n"); - LED_red_logged = 1; - } else { - LED_red_logged = 0; + + if (LED_yellow_logged != LED_yellow_state) { + if (LED_yellow_state == 1) { + pi.printf("&06\n"); + LED_yellow_logged = LED_yellow_state; + } + if (LED_yellow_state == 0) { + pi.printf("&60\n"); + LED_yellow_logged = LED_yellow_state; + } } - if () { - pi.printf("&05\n"); - LED_yellow_logged = 1; - } else { - LED_yellow_logged = 0; + if (LED_green_logged != LED_green_state) { + if (LED_green_state == 1) { + pi.printf("&05\n"); + LED_green_logged = LED_green_state; + } + if (LED_green_state == 0) { + pi.printf("&50\n"); + LED_green_logged = LED_green_state; + } } - if () { - pi.printf("&06\n"); - LED_green_logged = 1; - } else { - LED_green_logged = 0; + if (speaker_logged != speaker_state) { + if (speaker_state == 1) { + pi.printf("&07\n"); + speaker_logged = speaker_state; + } + if (speaker_state == 0) { + pi.printf("&70\n"); + speaker_logged = speaker_state; + } } - - if ((speaker_flag_current == 1) && (speaker_flag_last == 0)) { - pi.printf("&07\n"); - speaker_flag_current = 0; - } - - if ((speaker_flag_current == 0) && (speaker_flag_last == 1)) { - pi.printf("&70\n"); - speaker_flag_last = 0; - } */ + + if (power_plug_logged != power_plug_state) { + if (power_plug_state == 1) { + pi.printf("&07\n"); + power_plug_logged = power_plug_state; + } + if (power_plug_state == 0) { + pi.printf("&70\n"); + power_plug_logged = power_plug_state; + } + } } int main()