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.
Diff: main.cpp
- Revision:
- 5:7fa3a2a2f603
- Parent:
- 4:4b9d96e6c509
diff -r 4b9d96e6c509 -r 7fa3a2a2f603 main.cpp
--- a/main.cpp Mon Mar 04 16:05:02 2019 +0000
+++ b/main.cpp Mon Mar 04 16:41:34 2019 +0000
@@ -5,19 +5,20 @@
Serial pc(SERIAL_TX, SERIAL_RX);
int main() {
+ float odomX, odomY, odomTheta;
pc.baud(115200);
- init_radio(&pc);
+ init_communication(&pc);
while(1) {
- //getCountsAndReset(); // Call getCountsAndReset() to read the values of encoders
+ getCountsAndReset(); // Call getCountsAndReset() to read the values of encoders
// and reset them. The values become available on variables
// "countsLeft" and "countsRight".
// setSpeeds(20, 50); // Uncomment to set a speed of 20 for the
// left motor and 50 for the right motor.
- pc.printf("Encoders: Left=%d Right=%d\n", countsLeft, countsRight);
- send_odometry(1333, 2889, 3.286, 4.23, 54.29);
+ pc.printf("ASCII message - Left=%d Right=%d\n", countsLeft, countsRight);
+ send_odometry(1, 2, countsLeft, countsRight, odomX, odomY, odomTheta);
wait(0.5); // Delay of 0.5 seconds.
}
}
\ No newline at end of file