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.
calibration.cpp
00001 #include "calibration.h" 00002 #include "DRV8825.h" 00003 #include "motors.h" 00004 00005 extern Serial pc; 00006 extern DRV8825 stpr_mtr1; 00007 extern DRV8825 stpr_mtr2; 00008 00009 void calibrate(char motor, char* direction){ 00010 int i,j, dir; 00011 pc.printf("Direction = %s\n", (strcmp(direction,"left")==0)?"left":"right"); 00012 pc.printf("Motor = %c\n", motor=='a' ? 'a':'b'); 00013 if((strcmp(direction,"right")==0 && motor=='a') || (strcmp(direction,"left")==0 && motor=='b')) dir=1; else dir=0; 00014 for(j=0; j<200; j++) { //500 rotations 00015 for (i = 500; i < MAX_SPEED; i+=100) { 00016 if (motor=='a') stpr_mtr1.settings(1, dir, i); 00017 else stpr_mtr2.settings(1, dir, i); 00018 } 00019 } 00020 } 00021 00022 void test_interrupts() { 00023 00024 } 00025 00026
Generated on Wed Jul 13 2022 10:07:54 by
1.7.2