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
Fork of Robot2mooiemanier by
Revision 16:8e56aa6f4b7a, committed 2014-10-31
- Comitter:
- Jolein
- Date:
- Fri Oct 31 09:45:07 2014 +0000
- Parent:
- 15:737f5f448eb7
- Child:
- 17:71c5c9bfb7ba
- Commit message:
- met setpos(0) eerste test
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 31 09:40:30 2014 +0000
+++ b/main.cpp Fri Oct 31 09:45:07 2014 +0000
@@ -616,9 +616,9 @@
void motor1aansturing()
{
- if (motor1.getPosition()>= ANGLEMIN && toestand != SLAAN) {
+ if (motor1.getPosition()>= ANGLEMAX && toestand != SLAAN) {
toestand = WACHTEN;
- //out_i=0;
+ motor1.setPosition(0);
pid(0,0,true);
pc.printf("if1\n");
}
@@ -636,11 +636,11 @@
}
}
if (toestand == SLAAN && motor1.getPosition() <= ANGLEMAX) {
+ toestand = TERUGKEREN;
+ motor1.setPosition(0);
+ pid(0,0,true);
+ stop = 1; //zorgt dat hij niet weer gaat slaan tot er gereset is...
pc.printf("toestand = terugkeren\n\r");
- //out_i=0;
- pid(0,0,true);
- toestand = TERUGKEREN;
- stop = 1; //zorgt dat hij niet weer gaat slaan tot er gereset is...
}
if (toestand == TERUGKEREN) {
new_pwm = pid(setspeed, motor1.getSpeed(),false);
