prima intalinre pelicanii
Dependencies: Motor
Revision 16:b6929dbb9e67, committed 2020-12-11
- Comitter:
- catalinasirbuBSH
- Date:
- Fri Dec 11 11:18:23 2020 +0000
- Parent:
- 15:22769c20e263
- Commit message:
- 11_dec_2020 _prima intalnire
Changed in this revision
Sources/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Sources/main.cpp Sun Apr 26 17:38:19 2020 +0000 +++ b/Sources/main.cpp Fri Dec 11 11:18:23 2020 +0000 @@ -7,7 +7,9 @@ // --- MACROS --- # define PULS_PER_REV 2048 # define THRESHOLD 10 -# define BAUDRATE 460800 + +// Pe raspberry maxim merge 115200 +# define BAUDRATE 19200 # define M_PI 3.14159265358979323846 /* pi */ # define STEP 0.06 @@ -28,8 +30,8 @@ // Setting the Motor's pins Motor motor(D3, D2, D4); // pwm, fwd, rev -// Setting the Servo's pin -Servo reelyServo(D9); +// Setting the Servo's pin // ERA D9 +Servo reelyServo(D5); // Declare one timer for driving with constant speed (PID) Timer timer; @@ -80,8 +82,6 @@ inline float normalize_speed(float comanda_speed, const float margin=0.5f); - - int main() { enc1.rise(&count_rising); @@ -276,8 +276,8 @@ if(*ptr != '.' && *ptr !='\0' && *ptr != '\r' && *ptr != '\n') { - pc.printf("From __**charToFloat**__ : The format is incorrect. Expected '.' as separator\n"); - pc.printf(" and received '%c'", *ptr); + //pc.printf("From __**charToFloat**__ : The format is incorrect. Expected '.' as separator\n"); + //pc.printf(" and received '%c'", *ptr); return 0.0f; } else @@ -506,8 +506,8 @@ if(margin < 0.0f || margin > 1.0f) { - pc.printf("In function __**normalize_speed**__ [ @param margin ] must be POSITIVE\n"); - pc.printf("and situated between [0, +1.0f]"); + //pc.printf("In function __**normalize_speed**__ [ @param margin ] must be POSITIVE\n"); + //pc.printf("and situated between [0, +1.0f]"); return 0.0f; } else