Horng-Yih Lai
/
mbed_Motor_Control
mbed DC Motor Control
Revision 0:9be8dbe348a2, committed 2015-02-09
- Comitter:
- s890506
- Date:
- Mon Feb 09 11:26:48 2015 +0000
- Commit message:
- mbed DC Motor Control
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 Mon Feb 09 11:26:48 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; + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Feb 09 11:26:48 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa \ No newline at end of file