MEM
/
ES_6_P4
Motori DC
Revision 0:f622df532a43, committed 2016-11-06
- Comitter:
- Mattinico
- Date:
- Sun Nov 06 19:35:58 2016 +0000
- Commit message:
- k
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MotorMR001-004.lib Sun Nov 06 19:35:58 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/simon/code/Motor/#f265e441bcd9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Nov 06 19:35:58 2016 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "Motor.h" + +Motor m1(D10, D8, D9); //pwm (E1), fwd (1A), rev (1B) +Motor m2(D5, D6, D7); //pwm (E2), fwd (2A), rev (2B) +DigitalIn button(PC_13); + +int main() { + while(1) { + if (button==0) { + m1.speed(0.6); + m2.speed(0.6); + wait(2); + m1.speed(-0.6); + m2.speed(-0.6); + wait(2); + } + else { + m1.speed(0); + m2.speed(0); + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Nov 06 19:35:58 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file