Project 2
/
ES200_lab2-2
DC Motor
Fork of ES200_lab2 by
Revision 0:0ca8b8fe09f6, committed 2018-10-01
- Comitter:
- m211656
- Date:
- Mon Oct 01 18:53:40 2018 +0000
- Commit message:
- DC Motor
Changed in this revision
diff -r 000000000000 -r 0ca8b8fe09f6 Motor.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor.lib Mon Oct 01 18:53:40 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/m211656/code/Motor/#420a402c1e5a
diff -r 000000000000 -r 0ca8b8fe09f6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 01 18:53:40 2018 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "Motor.h" + +Motor m(p26,p29,p30); +int main() +{ + float f; + for(f=.2; f<1; f+=.2) { + m.speed(f); + printf("speed is %f \n\r", f); + getchar(); + m.speed(-f); + printf("speed is - %f \n\r", f); + if(f==.8) { + break; + } + getchar(); + } + while(1) { + getchar(); + m.speed(1); + printf("speed is 1 \n\r"); + getchar(); + m.speed(-1); + printf("speed is -1 \n\r"); + } +}
diff -r 000000000000 -r 0ca8b8fe09f6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 01 18:53:40 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file