o
Dependencies: MotorDriver_SU USBDevice mbed
Revision 3:333dc85aa5a9, committed 2014-11-27
- Comitter:
- 12F2045K
- Date:
- Thu Nov 27 04:41:43 2014 +0000
- Parent:
- 2:aae9d053cb5d
- Commit message:
- o
Changed in this revision
diff -r aae9d053cb5d -r 333dc85aa5a9 MotorDriver_SU.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MotorDriver_SU.lib Thu Nov 27 04:41:43 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/NT32/code/MotorDriver_SU/#e6c391eb8fac
diff -r aae9d053cb5d -r 333dc85aa5a9 USBDevice.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Thu Nov 27 04:41:43 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/USBDevice/#37f14e05bfd7
diff -r aae9d053cb5d -r 333dc85aa5a9 main.cpp --- a/main.cpp Sun Sep 21 19:05:22 2014 +0000 +++ b/main.cpp Thu Nov 27 04:41:43 2014 +0000 @@ -1,15 +1,17 @@ #include "mbed.h" - -AnalogIn ain(p19); -DigitalOut led(LED1); - -// Turn on led if analog voltage > 30% of supply voltage +#include "MotorDriver_SU.h" +DigitalIn sw(P0_1,PullUp); +AnalogIn sensorleft(P0_23),sensorcenter(P0_14),sensorright(P0_12),sensorlift(P0_22); +MotorDriver_SU motor(MOTOR_DOUBLE); +MotorDriver_SU lift(MOTOR_SINGLE); int main() { - while (1){ - if(ain > 0.3) { - led = 1; - } else { - led = 0; + while(1){ + if(sw==0){ + lift.Drive(0,CW,2000); + } + else{ + lift.Drive(0,CCW,2000); } } -} \ No newline at end of file +} +