From 0ae7b4cc841cb2738fe5db3419af0887286f43b0 Mon Sep 17 00:00:00 2001 From: Tetsuya Kanja Date: Mon, 2 Sep 2013 00:10:41 +0900 Subject: [PATCH] =?utf8?q?tokai=5Fex4=E3=81=AE=E3=82=88=E3=81=86=E3=81=AA?= =?utf8?q?=E3=82=AD=E3=83=A3=E3=83=AA=E3=83=96=E3=83=AC=E3=83=BC=E3=82=B7?= =?utf8?q?=E3=83=A7=E3=83=B3=E3=82=92=E9=81=A9=E5=BD=93=E3=81=AB=E5=AE=9F?= =?utf8?q?=E8=A3=85=E3=81=97=E3=81=A6=E3=83=A9=E3=82=A4=E3=83=B3=E3=83=88?= =?utf8?q?=E3=83=AC=E3=83=BC=E3=82=B9=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ETBalanceRunner.cpp | 3 ++- main.cpp | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/ETBalanceRunner.cpp b/ETBalanceRunner.cpp index 1f73778..835ad28 100644 --- a/ETBalanceRunner.cpp +++ b/ETBalanceRunner.cpp @@ -12,6 +12,7 @@ namespace ecrobot{ ETBalanceRunner::ETBalanceRunner(Motor& motorL, Motor& motorR, GyroSensor& gyro, Nxt& nxt) : m_motorL(motorL), m_motorR(motorR), m_gyro(gyro), m_nxt(nxt), m_gyrooffset(610) { + balance_init(); } ETBalanceRunner::~ETBalanceRunner(void) { @@ -19,7 +20,7 @@ ETBalanceRunner::~ETBalanceRunner(void) void ETBalanceRunner::Run(int forward, int turn) { S8 r,l; - balance_control(forward,turn,m_gyro.getAnglerVelocity(),m_gyrooffset,m_motorL.getCount(),m_motorR.getCount(),m_nxt.getBattMv(),&l,&r); + balance_control(forward,turn,m_gyro.get(),m_gyrooffset,m_motorL.getCount(),m_motorR.getCount(),m_nxt.getBattMv(),&l,&r); m_motorL.setPWM(l); m_motorR.setPWM(r); } diff --git a/main.cpp b/main.cpp index e0ea1b3..e979f1c 100644 --- a/main.cpp +++ b/main.cpp @@ -64,6 +64,68 @@ TASK(TaskMain) lcd.putf("s", "Hello World"); lcd.disp(); + // TODO:‚Æ‚è‚ ‚¦‚¸‚̃LƒƒƒŠƒuƒŒ[ƒVƒ‡ƒ“ + static const int sum_num = 256; + unsigned long sum = 0; + char str[16+1]; + // ƒWƒƒƒCƒ + while(!touch.isPressed()){ + } + while(touch.isPressed()){ + } + for(int i=0;i