kazushiro tanimoto
/
sagawa_lpc1114
Sagawa Electronics,inc.
Fork of sagawa_lpc1114 by
Diff: main.cpp
- Revision:
- 2:de000dc1b277
- Parent:
- 1:dbde3f68f80d
diff -r dbde3f68f80d -r de000dc1b277 main.cpp --- a/main.cpp Sat Nov 26 19:09:24 2016 +0000 +++ b/main.cpp Sat Nov 26 19:25:42 2016 +0000 @@ -24,20 +24,20 @@ #include "TB6612.h" #include "SoftPWM.h" -DigitalOut led1(P2_11); -DigitalOut led2(P0_2); -DigitalOut led3(P0_7); -DigitalOut led4(P0_3); +DigitalOut led1(P2_11); // LDE1 setting. +DigitalOut led2(P0_2); // LDE2 setting. +DigitalOut led3(P0_7); // LDE3 setting. +DigitalOut led4(P0_3); // LDE4 setting. -AnalogIn ad0(P0_11); -AnalogIn ad1(P1_0); -AnalogIn ad2(P1_1); -AnalogIn ad3(P1_2); -AnalogIn ad5(P1_4); -AnalogIn ad7(P1_11); +AnalogIn ad0(P0_11); //AD0port setting. +AnalogIn ad1(P1_0); //AD1port setting. +AnalogIn ad2(P1_1); //AD2port setting. +AnalogIn ad3(P1_2); //AD3port setting. +AnalogIn ad5(P1_4); //AD5port setting. +AnalogIn ad7(P1_11); //AD7port setting. -TB6612 motor1a(P2_7,P2_9,P2_8); -TB6612 motor1b(P2_4,P2_6,P2_5); +TB6612 motor1a(P2_7,P2_9,P2_8); //TB6612 setting. +TB6612 motor1b(P2_4,P2_6,P2_5); //TB6612 setting. Serial pc(P1_7, P1_6); @@ -54,29 +54,29 @@ while(1) { - led1 = 1; - motor1a = 0.2; // Motor forward. - wait(1.0); - led1 = 0; + led1 = 1; // LDE1 enable. + motor1a = 0.2; // Motor1A forward. + wait(1.0); //wait 1 second. + led1 = 0; // LDE1 disable. - led2 = 1; - motor1a = -0.2; // Motor reversal. - wait(1.0); - led2 = 0; + led2 = 1; // LDE2 enable. + motor1a = -0.2; // Motor1A reversal. + wait(1.0); //wait 1 second. + led2 = 0; // LDE1 disable. - motor1a = 0.0; + motor1a = 0.0; // Motor1A brake. - led3 = 1; - motor1b = 0.2; // Motor forward. - wait(1.0); - led3 = 0; + led3 = 1; // LDE3 enable. + motor1b = 0.2; // Motor1B forward. + wait(1.0); //wait 1 second. + led3 = 0; // LDE1 disable. - led4 = 1; - motor1b = -0.2; // Motor reversal. - wait(1.0); - led4 = 0; + led4 = 1; // LDE4 enable. + motor1b = -0.2; // Motor1B reversal. + wait(1.0); //wait 1 second. + led4 = 0; // LDE1 disable. - motor1b = 0.0; + motor1b = 0.0; // Motor1B brake. pc.printf("check_ok \r\n"); }