Brett Eckert
/
ES200_lab2
DC Motor
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
--- /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
--- /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"); + } +}
--- /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