Yoji KURODA
/
Mechatro_MotorControl
Mechatro example program
Revision 0:a17e11284fc5, committed 2017-10-05
- Comitter:
- ykuroda
- Date:
- Thu Oct 05 07:50:42 2017 +0000
- Commit message:
- 1st commit;
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 a17e11284fc5 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 05 07:50:42 2017 +0000 @@ -0,0 +1,23 @@ +// Motor Control ... Mechatronics example program +// +// 2017.10.05 ... Y.Kuroda +// +#include "mbed.h" + +PwmOut a1(D1); +DigitalOut a2(D12); + +int main() { + + a1.period_ms(1); + + while(1) { + a1 = 0.1; // duty is 10% + a2 = 0; + wait(3); // 3 s + + a1 = 0.9; // duty is 10%!!! + a2 = 1; + wait(3); // 3 sec + } +}
diff -r 000000000000 -r a17e11284fc5 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 05 07:50:42 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/235179ab3f27 \ No newline at end of file