mbed school
/
mbed_DCMotor_Control
DCMotor Control
Revision 0:9326024c4b59, committed 2015-02-10
- Comitter:
- mbedschool
- Date:
- Tue Feb 10 02:26:59 2015 +0000
- Commit message:
- DCMotor
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 |
diff -r 000000000000 -r 9326024c4b59 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Feb 10 02:26:59 2015 +0000 @@ -0,0 +1,29 @@ +#include "mbed.h" + +DigitalOut ledForPower1(LED1); +DigitalOut ledForPower2(LED2); +DigitalOut ledForPower3(LED3); +DigitalOut ledForPower4(LED4); +PwmOut motor(p21); + +int main() { + + motor=0; + wait(2); + + motor=0.4; + ledForPower1=1; + wait(2); + + motor=0.6; + ledForPower2=1; + wait(2); + + motor=0.8; + ledForPower3=1; + wait(2); + + motor=1; + ledForPower4=1; + +}
diff -r 000000000000 -r 9326024c4b59 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Feb 10 02:26:59 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa \ No newline at end of file