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:
- 32:13aba70baa4b
- Parent:
- 31:cef6ee7af014
- Child:
- 33:d939479e7b13
--- a/main.cpp Mon Feb 13 06:08:05 2017 +0000 +++ b/main.cpp Thu Feb 16 07:08:54 2017 +0000 @@ -7,7 +7,8 @@ //@todo 使っているライブラリの関数の説明追加 -//selctor回りの削除 servo回りはシリアルに変更 xbee周りの削除とvoltをDisplayで送るよう変更 +//servo回りはシリアルに変更 +//selector周りはコメントアウトしてる //タスクの数に上限があるっぽい(6個以下) // @@ -23,7 +24,6 @@ #include "Atmpress.h" #include "BatteryChecker.h" #include "Display.h" -#include "XBee.h" //#include "Selector.h" #include "TweLite_Sensors.h" #define CADENCE 0 @@ -36,10 +36,9 @@ 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 // 要変更 +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); @@ -65,7 +64,7 @@ while(1){ //この中でpc.printfはしないほうがいいみたい(9600bpsだと遅延が起こる) controllerManager.update(); - //servoManager.update(); + servoManager.update(); //selector.update(); wdt = !wdt;//ウォッチドッグタイマのkickに相当 Thread::wait(50); @@ -77,7 +76,7 @@ //batteryCheckerとatmpressを入れ替えると10minくらいで停止する。わけわからん airspeed.update(); tweLite_Sensors.update(CADENCE);//こっちでそれぞれのbatteryをupdata - tweLite_Sensors.update(ULTSONIC); + tweLite_Sensors.update(ULTSONIC);//BatteryCheckerにまとめたい batteryChecker.update(); atmpress.update(); Thread::wait(500); @@ -92,12 +91,6 @@ } } -void xbeeTask(void const *pvParameters){ - while(1){ - xbee.update(); - Thread::wait(50); - } -} int main(void){ @@ -109,7 +102,6 @@ Thread ControlTask(controlTask, NULL, osPriorityRealtime); Thread SensorTask500(sensorTask500); Thread DisplayTask(displayTask); - Thread XbeeTask(xbeeTask); printf("Task end\n"); Thread::wait(osWaitForever);