OSDN Git Service

ETBalanceRunnerの不具合修正とStopで止まるようにした
authorkanja <hoge@hoge.hg>
Thu, 12 Sep 2013 12:39:34 +0000 (21:39 +0900)
committerkanja <hoge@hoge.hg>
Thu, 12 Sep 2013 12:39:34 +0000 (21:39 +0900)
ETBalanceRunner.cpp
main.cpp

index f0625ef..b227673 100644 (file)
@@ -27,7 +27,7 @@ void ETBalanceRunner::Run(int forward, int turn)
                r = r + (l - 100);\r
                l = 100;\r
        }else if(r < -100){\r
-               l = l - (r - (-100));\r
+               l = l + (r - (-100));\r
                r = -100;\r
        }\r
        m_motorL.setPWM(l);\r
index 9f85447..7645d2c 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -224,8 +224,11 @@ TASK(Task4ms)
        if(touch.isPressed()){\r
 //             motorR.setPWM(0);\r
 //             motorL.setPWM(0);\r
+               tracer.Stop();\r
+               tracer.Reset();\r
                ActivateTask(TaskMain);\r
                TerminateTask();\r
+               return;\r
        }\r
     context.Display(lcd);\r
     context.CyclicExcute();\r