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.
Diff: Control.cpp
- Revision:
- 2:43e1336c80e4
- Parent:
- 1:39ada37dfdbe
- Child:
- 3:42a8da1837f7
--- a/Control.cpp Fri Dec 27 05:43:32 2019 +0000 +++ b/Control.cpp Fri Dec 27 08:16:50 2019 +0000 @@ -10,12 +10,16 @@ Vx = sb.JoyStick_dt[0] * -1; Vy = sb.JoyStick_dt[1]; wl = sb.JoyStick_dt[2]; + /*vx = sb.UP_bit() + vy = sb.DOWN_bit()*/ + pwm[0]= (Vx - Vy)*bias[0] + wl; pwm[1]=(-1)*(Vx + Vy)*bias[1] + wl; pwm[2]=(-1)*(Vx - Vy)*bias[2] + wl; pwm[3]= (Vx + Vy)*bias[3] + wl; + for(int i = 0; i < 4; i++){ if(pwm[i] > 127){ pwm[i] =127;