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:
- 33:d939479e7b13
- Parent:
- 32:13aba70baa4b
- Child:
- 34:770a6bbb4d63
diff -r 13aba70baa4b -r d939479e7b13 main.cpp --- a/main.cpp Thu Feb 16 07:08:54 2017 +0000 +++ b/main.cpp Wed Mar 01 08:05:52 2017 +0000 @@ -9,6 +9,7 @@ //servo回りはシリアルに変更 //selector周りはコメントアウトしてる +//cadence,ultsonicまわりをfloatにかえる //タスクの数に上限があるっぽい(6個以下) // @@ -22,7 +23,6 @@ #include "Trim.h" #include "Airspeed.h" #include "Atmpress.h" -#include "BatteryChecker.h" #include "Display.h" //#include "Selector.h" #include "TweLite_Sensors.h" @@ -35,7 +35,6 @@ 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); @@ -75,14 +74,17 @@ while(1){ //batteryCheckerとatmpressを入れ替えると10minくらいで停止する。わけわからん airspeed.update(); - tweLite_Sensors.update(CADENCE);//こっちでそれぞれのbatteryをupdata - tweLite_Sensors.update(ULTSONIC);//BatteryCheckerにまとめたい - batteryChecker.update(); atmpress.update(); Thread::wait(500); } } +void twesensorTask(void const *pvParameters){ + while(1){ + tweLite_Sensors.update();//こっちでそれぞれのbatteryをupdata + } +} + void displayTask(void const *pvParameters){ while(1){ @@ -101,6 +103,7 @@ Thread InitializeTask(initializeTask); Thread ControlTask(controlTask, NULL, osPriorityRealtime); Thread SensorTask500(sensorTask500); + Thread TwesensorTask(twesensorTask); Thread DisplayTask(displayTask); printf("Task end\n");