Opis znajduje sie w main.cpp
Dependencies: mbed Motordriver
Revision 5:765e3090ce0c, committed 2019-03-05
- Comitter:
- kociol1994
- Date:
- Tue Mar 05 10:14:36 2019 +0000
- Parent:
- 4:2171346afc64
- Commit message:
- abc;
Changed in this revision
| main1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main1.cpp Sun Mar 03 16:41:45 2019 +0000
+++ b/main1.cpp Tue Mar 05 10:14:36 2019 +0000
@@ -10,7 +10,6 @@
float X0, X1, X;
float Y0, Y1, Y;
int dzielnik = 2; //dzielnik prędkosci PWM
-
Motor mot_A(D6, D4, D7, 1); // pwm, fwd, rev, can brake
Motor mot_B(D5, D3, D2, 1); // pwm, fwd, rev, can brake
@@ -22,8 +21,7 @@
// inicjacja portu szeregowego
Serial pc(SERIAL_TX, SERIAL_RX);
-
-//--------funkcja mapująca zmienne X i Y-----------------
+ //--------funkcja mapująca zmienne X i Y-----------------
float map(float Q, float A, float B, float C, float D){
return ((D-C)/(B-A)*(Q-A)+C);
}
@@ -78,13 +76,11 @@
wait_ms(50);
// --------wpisz wartosc PWM-----------
-
//zależność między położeniem Joy a obrotami kół
float L = Y + (X/2);
float P = Y - (X/2);
mot_A.speed(L/dzielnik);
mot_B.speed(P/dzielnik);
-
}
}
\ No newline at end of file