Guardians of the Galaxy
/
testdcmotor
dangerous spin things
Revision 0:fa52c6fc593f, committed 2014-10-09
- Comitter:
- tsevcik08
- Date:
- Thu Oct 09 19:08:54 2014 +0000
- Child:
- 1:90b569aa2335
- Commit message:
- spin crain
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor.lib Thu Oct 09 19:08:54 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Motor/#f265e441bcd9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 09 19:08:54 2014 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "Motor.h" + +Motor kate(p26, p29, p30); +DigitalIn sw2(p17); +DigitalIn sw3(p18); + +int main() +{ + float mspeed; + while(1) { + if( sw2 == 1 ) { + mspeed = 0.35; + kate.speed(mspeed); + wait(.03); + mspeed = 0.0; + kate.speed(mspeed); + wait(.05); + + } else if (sw2 == 0) { + mspeed = 0.0; + kate.speed(mspeed); + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 09 19:08:54 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file