Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 31:cef6ee7af014
- Parent:
- 30:6d3a78bc1925
- Child:
- 32:13aba70baa4b
--- a/main.cpp Thu Dec 29 11:36:49 2016 +0000 +++ b/main.cpp Mon Feb 13 06:08:05 2017 +0000 @@ -7,6 +7,8 @@ //@todo 使っているライブラリの関数の説明追加 +//selctor回りの削除 servo回りはシリアルに変更 xbee周りの削除とvoltをDisplayで送るよう変更 + //タスクの数に上限があるっぽい(6個以下) // @@ -22,22 +24,24 @@ #include "BatteryChecker.h" #include "Display.h" #include "XBee.h" -#include "Selector.h" +//#include "Selector.h" #include "TweLite_Sensors.h" +#define CADENCE 0 +#define ULTSONIC 1 RawSerial pc(USBTX, USBRX); -Atmpress atmpress(p9, p10);//sda, scl -Display display(p13, p14, NC);//tx, rx, sw -ControllerManager controllerManager(p15,p16,p5,p6);//ele, rud, eletrimup, eletrimdown -BatteryChecker batteryChecker(p17, p18); -ServoManager servoManager(p21, p22);//ele, rud -Selector selector(p25); -DigitalOut wdt(p26); -XBee xbee(p28, p27);//tx, rx -Airspeed airspeed(p29, NC, NC);//p19,p20をInterruptInに使ってはいけない -TweLite_Sensors(PinName tx, PinName rx); +Atmpress atmpress(PB_7, PA_15);//sda, scl +Display display(PC_4, PA_10, NC);//tx, rx, sw +ControllerManager controllerManager(PC_0,PC_1,PA_4,PA_1);//ele, rud, eletrimup, eletrimdown +BatteryChecker batteryChecker(p18);//どのピンか確認 +//ServoManager servoManager(p21, p22);//ele, rud // 要変更 +//Selector selector(p25); +DigitalOut wdt(PA_14); +//XBee xbee(p28, p27);//tx, rx +Airspeed airspeed(PA_13, NC, NC);//p19,p20をInterruptInに使ってはいけない +TweLite_Sensors tweLite_Sensors(PC_12,PD_2); @@ -61,8 +65,8 @@ while(1){ //この中でpc.printfはしないほうがいいみたい(9600bpsだと遅延が起こる) controllerManager.update(); - servoManager.update(); - selector.update(); + //servoManager.update(); + //selector.update(); wdt = !wdt;//ウォッチドッグタイマのkickに相当 Thread::wait(50); } @@ -72,8 +76,8 @@ while(1){ //batteryCheckerとatmpressを入れ替えると10minくらいで停止する。わけわからん airspeed.update(); - TweLite_Sensors::updata("cadence"); - TweLite_Sensors::updata("ultsonic"); + tweLite_Sensors.update(CADENCE);//こっちでそれぞれのbatteryをupdata + tweLite_Sensors.update(ULTSONIC); batteryChecker.update(); atmpress.update(); Thread::wait(500);