Alexander Nordskov
/
LAB08_Oppgave3
s
Revision 0:78f70f725dfd, committed 2015-10-22
- Comitter:
- Voldread
- Date:
- Thu Oct 22 15:08:34 2015 +0000
- Commit message:
- s
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 22 15:08:34 2015 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "PwmOut.h" + +PwmOut servoMotor(PA_7); +AnalogIn pot(PA_1); +DigitalOut Vcc(PA_0); +DigitalOut Gnd(PA_4); + +int main() +{ + Vcc=1; + Gnd=0; + servoMotor.period(.01); + + while (true) + { + //float spenning=pot.read(); + float Pulsewidth=1000+pot.read()*1000; + servoMotor.pulsewidth_us(Pulsewidth); + wait_ms(1); + } +} + + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 22 15:08:34 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68 \ No newline at end of file