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: Encoder HIDScope MODSERIAL mbed-dsp mbed
Fork of BMT-M9_motorcontrol by
Revision 2:5f5b229b004d, committed 2013-10-08
- Comitter:
- vsluiter
- Date:
- Tue Oct 08 14:55:40 2013 +0000
- Parent:
- 1:5ac85aad9da4
- Child:
- 3:1e8e76b775b7
- Commit message:
- Added averageing of potmeter;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 26 13:08:21 2013 +0000
+++ b/main.cpp Tue Oct 08 14:55:40 2013 +0000
@@ -60,8 +60,8 @@
while(!looptimerflag);
looptimerflag = false;
setpoint = (getpotAverage())*2000;
- new_pwm = (setpoint - motor1.getPosition())*.001;
- //new_pwm = pid(setpoint, motor1.getPosition());
+ //new_pwm = (setpoint - motor1.getPosition())*.001;
+ new_pwm = pid(setpoint, motor1.getPosition());
coerce(&new_pwm, -1,1);
if(new_pwm > 0)
motordir = 1;
