Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MPU6050IMU QEI RPCInterface mbed
Fork of zumy_mbed by
Revision 15:3cee564f9d47, committed 2016-04-07
- Comitter:
- jlamyi
- Date:
- Thu Apr 07 23:31:21 2016 +0000
- Parent:
- 14:a153ce7cc4c8
- Commit message:
- Achieved 70Hz data sending rate by two RPCFunction calls
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Apr 07 21:17:10 2016 +0000
+++ b/main.cpp Thu Apr 07 23:31:21 2016 +0000
@@ -9,8 +9,10 @@
SerialRPCInterface SerialRPC(USBTX, USBRX, 115200);
-void GetSensorData(char* input, char* output);
-RPCFunction gsd(&GetSensorData, "gsd");
+void GetIMUData(char* input, char* output);
+RPCFunction gid(&GetIMUData, "gid");
+void GetEncoderData(char* input, char* output);
+RPCFunction ged(&GetEncoderData, "ged");
void Reset(char* input, char* output);
RPCFunction rst(&Reset, "rst");
//void WD_init(char* input, char* output);
@@ -117,16 +119,19 @@
}
// for testing where is the bug
- main_loop2 = main_loop;
+ //main_loop2 = main_loop;
- //SerialRPC.pc.printf("Data: %d,%d,%f,%f,%f,%f,%f,%f\r\n", l_enc, r_enc, accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z);
}
}
// RPCFunction
-void GetSensorData(char* input, char* output){
- sprintf(output, "%d,%d,%f,%f,%f,%f,%f,%f", l_enc, r_enc, accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z);
+void GetIMUData(char* input, char* output){
+ sprintf(output, "%f,%f,%f,%f,%f,%f", accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z);
+}
+
+void GetEncoderData(char* input, char* output){
+ sprintf(output, "%d,%d", l_enc, r_enc);
}
void Reset(char* input, char* output){
