GDP 4
/
mbed_transferfunction
Steering Servo Step responses
Revision 0:4a3f069b314a, committed 2016-11-24
- Comitter:
- oj3g13
- Date:
- Thu Nov 24 10:39:45 2016 +0000
- Commit message:
- Mbed initialises servos, waits 3 seconds, moves servo to different PWM values at random time intervals
Changed in this revision
diff -r 000000000000 -r 4a3f069b314a FRDM-TFC.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FRDM-TFC.lib Thu Nov 24 10:39:45 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/emh203/code/FRDM-TFC/#24430a0d7fd8
diff -r 000000000000 -r 4a3f069b314a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 24 10:39:45 2016 +0000 @@ -0,0 +1,62 @@ +#include "mbed.h" +#include "TFC.h" +#define MULTIPLIER 0.25 + +DigitalOut gpo(D0); + +int main() +{ + TFC_Init(); + TFC_InitServos(0.00052,0.00122,0.02); + float i; + wait(3); + float rand_max=RAND_MAX; + while(true) + { + i = (rand()/rand_max)*MULTIPLIER; + + + + + gpo = !gpo; // toggle pin + TFC_SetServo(0,-1.0); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,0.4); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,0); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,-0.6); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,-0.5); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,-0.7); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,0.9); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + gpo = !gpo; + TFC_SetServo(0,0.5); + wait(i); + i = (rand()/rand_max)*MULTIPLIER; + + } + } \ No newline at end of file
diff -r 000000000000 -r 4a3f069b314a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 24 10:39:45 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf \ No newline at end of file