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.
Dependencies: QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo
Fork of 17robo_fuzi by
accelerator_.h
00001 class Accel 00002 { 00003 public : 00004 void setup(float Acceleration, float time) { 00005 a = Acceleration*time; 00006 v = 0; 00007 } 00008 00009 float duty(float target) { 00010 if (fabs(target-v) <= a){ 00011 v = target; 00012 } else if (v < target) { 00013 v = v + a; 00014 } else if (v > target) { 00015 v = v - a; 00016 } 00017 return v; 00018 } 00019 00020 private : 00021 float a; 00022 float v; 00023 };
Generated on Mon Aug 8 2022 20:27:09 by
