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:
- 27:77065263c0ea
- Parent:
- 26:9e130f7ee829
- Child:
- 28:b4bee068780d
diff -r 9e130f7ee829 -r 77065263c0ea Sensorplate/main.cpp --- a/Sensorplate/main.cpp Tue Oct 03 15:30:36 2017 +0000 +++ b/Sensorplate/main.cpp Tue Oct 03 16:07:01 2017 +0000 @@ -95,7 +95,8 @@ { if (pi.readable()) { char message[10]; - + pi.scanf("%s", message); + if (message[0] == '0') { intensity_select = 0; } @@ -199,6 +200,9 @@ power_plug_logged = power_plug_state; } } + + pi.printf("!,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%f,%f,%f,%f,%f,\n", res[4], res[7], res[6], res[5], res[1], res[0], res[2], res[3], elec[0], elec[1], elec[2], elec[3], elec[4], acce[0]*100, acce[1]*100, acce[2]*100, gyro[0]*100, gyro[1]*100, gyro[2]*100); // print all to serial port + //receiving order: 8 resistive sensors, 5 electric readings, 3 accelerometer axes, 3 gyroscope axes } void colour_select(char LED_colour) // Function to select the colour. @@ -500,8 +504,7 @@ } while(t.read_us()<(4.25*(cycle_time/5))) {} // Wait untill 85% of cycle - pi.printf("!,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%f,%f,%f,%f,%f,\n", res[4], res[7], res[6], res[5], res[1], res[0], res[2], res[3], elec[0], elec[1], elec[2], elec[3], elec[4], acce[0]*100, acce[1]*100, acce[2]*100, gyro[0]*100, gyro[1]*100, gyro[2]*100); // print all to serial port - //receiving order: 8 resistive sensors, 5 electric readings, 3 accelerometer axes, 3 gyroscope axes + serial_read(); serial_log(); }