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.
Revision 1:8c1e3382b4d7, committed 2016-10-07
- Comitter:
- csellier
- Date:
- Fri Oct 07 15:09:20 2016 +0000
- Parent:
- 0:65fd20a989e9
- Child:
- 2:0b86e6482e4b
- Commit message:
- Car project program
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 07 11:02:23 2016 +0000 +++ b/main.cpp Fri Oct 07 15:09:20 2016 +0000 @@ -1,13 +1,13 @@ #include "mbed.h" #include "Servo.h" Serial pc(USBTX, USBRX); // USB serial interface -Servo cr_srv1(p21); // continuous rotation hobby servo right -Servo cr_srv2(p22); // continuous rotation hobby servo left +Servo ServoRight(p21); // continuous rotation hobby servo right +Servo ServoLeft(p22); // continuous rotation hobby servo left void init_servo() { // calibrate the servos for +/-5ms over +/-45deg - cr_srv1.calibrate(0.0005,45); - cr_srv2.calibrate(0.0005,45); + ServoRight.calibrate(0.0005,45); + ServoLeft.calibrate(0.0005,45); } int main() { @@ -21,8 +21,8 @@ // sernd the servo command to the servos themselves - cr_srv1.write(0.6); // write to the continuous rotation servo1 - cr_srv2.write(0.4); // write to the continous servo2 + ServoRight.write(0.6); // write to the continuous rotation servo1 + ServoLeft.write(0.4); // write to the continous servo2 } }