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.
Fork of m3pi by
Diff: m3pi.cpp
- Revision:
- 9:f65c5aa1775c
- Parent:
- 7:9b128cebb3c2
--- a/m3pi.cpp Thu May 12 13:26:37 2011 +0000
+++ b/m3pi.cpp Mon Nov 23 23:22:28 2015 +0000
@@ -43,11 +43,11 @@
}
void m3pi::left_motor (float speed) {
- motor(0,speed);
+ motor(1,speed);
}
void m3pi::right_motor (float speed) {
- motor(1,speed);
+ motor(0,speed);
}
void m3pi::forward (float speed) {
@@ -112,6 +112,15 @@
return(fpos);
}
+void m3pi::calibrated_sensors(unsigned short ltab[5]) {
+ unsigned i;
+ _ser.putc(SEND_CALIB_SENSOR_VALUES);
+ for(i=0;i<5;i++){
+ ltab[i] = (unsigned short) _ser.getc();
+ ltab[i] += _ser.getc() << 8;
+ }
+}
+
char m3pi::sensor_auto_calibrate() {
_ser.putc(AUTO_CALIBRATE);
return(_ser.getc());
