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:3122058b3a2e, committed 2020-08-31
- Comitter:
- d2_h10s
- Date:
- Mon Aug 31 15:09:14 2020 +0000
- Parent:
- 0:283fc48ef873
- Commit message:
- for braille teams
Changed in this revision
| Robot.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Robot.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Robot.cpp Wed Aug 26 06:21:11 2020 +0000
+++ b/Robot.cpp Mon Aug 31 15:09:14 2020 +0000
@@ -83,8 +83,8 @@
}
void Robot::move_speed(uint8_t _dir, float _vel){
- LM.setSpeed(100);//(DESIRED_MICRO_STEPS_PER_SEC * 10 *(vel / 100));
- RM.setSpeed(100);//(DESIRED_MICRO_STEPS_PER_SEC * 10 * (vel / 100));
+ LM.setSpeed(DESIRED_MICRO_STEPS_PER_SEC * (_vel / 100));
+ RM.setSpeed(DESIRED_MICRO_STEPS_PER_SEC * (_vel / 100));
}
void Robot::turn_deg(uint8_t _dir, float _ang) {
--- a/Robot.h Wed Aug 26 06:21:11 2020 +0000
+++ b/Robot.h Mon Aug 31 15:09:14 2020 +0000
@@ -1,6 +1,7 @@
#include "mbed.h"
#include "mStepper.h"
+
typedef enum {go = 0,back = 1,left = 2,right = 3, both = 4} Direction; //global enumerator
typedef enum {CW = 0, CCW = 1} Clock;
@@ -28,4 +29,5 @@
void turn_deg(uint8_t _dir, float _ang); // robot turn left or right
void turn_LM(uint8_t _dir, float _ang, float _vel); // turn only left motor, default percent of velocity is 100%
void turn_RM(uint8_t _dir, float _ang, float _vel); // turn only right motor, default percent of velocity is 100%
-};
\ No newline at end of file
+};
+