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 TouchButton mbed-dsp mbed
Revision 1:5d30a2ea2e11, committed 2014-10-30
- Comitter:
- Jolein
- Date:
- Thu Oct 30 13:18:42 2014 +0000
- Parent:
- 0:1594bb11fa13
- Child:
- 2:455216d1b5ba
- Commit message:
- returnt niet, met pc printf
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Oct 30 12:21:27 2014 +0000
+++ b/main.cpp Thu Oct 30 13:18:42 2014 +0000
@@ -78,7 +78,7 @@
float new_pwm;
float PWM2 = 0.3; //PWM voor instellen hoek batje
int toestand = TERUGKEREN;
-float setspeed = 0, V3=60, V2=40, V1 =30, Vreturn= 15;//V in counts/s
+float setspeed = 0, V3=60, V2=40, V1 =30, Vreturn= 35;//V in counts/s
Encoder motor1(PTD5,PTD3);
@@ -628,20 +628,22 @@
}
}
if (toestand == SLAAN && abs(motor1.getPosition()) >= ANGLEMAX) {
+ pc.printf("toestand = terugkeren\n\r");
toestand = TERUGKEREN;
stop = 1; //zorgt dat hij niet weer gaat slaan tot er gereset is...
}
if (toestand == TERUGKEREN) {
+ pc.printf("motor gaat terugkeren\n\r");
new_pwm = pid(Vreturn, motor1.getSpeed());
pwm_motor1.write(new_pwm);
- motordir1 = 1;
+ motordir1 = 0;
}
if (toestand == WACHTEN) {
pwm_motor1.write(0);
}
if (toestand == SLAAN) {
new_pwm = pid(setspeed, motor1.getSpeed());
- motordir1 = 0;
+ motordir1 = 1;
pwm_motor1.write(new_pwm);
}
}
\ No newline at end of file