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:
- 12:8e39bb45c61c
- Parent:
- 11:af917eb0e624
- Child:
- 13:a8e10a69df45
--- a/main.cpp Sat Nov 28 15:08:59 2015 +0000 +++ b/main.cpp Sat Nov 28 18:47:26 2015 +0000 @@ -1,6 +1,4 @@ -//@todo timerの精度の確認 - -//@todo Initのコマンドモード化 +//@todo Initのコマンドモード化or別プログラム化 //@todo ソフトウェアシリアルの確認等 @@ -9,6 +7,10 @@ //@todo 高度計の追加 +//@todo Cadence, Airspeed内でNC,Encorderクラスから継承 + +//@todo 使っているライブラリの関数の説明追加 + #include "mbed.h" #include "rtos.h" #include "Global.h" @@ -18,7 +20,6 @@ #include "Trim.h" #include "Cadence.h" #include "Airspeed.h" -#include "Altitude.h" #include "Display.h" #include "XBee.h" @@ -26,20 +27,19 @@ RawSerial pc(USBTX, USBRX); Cadence cadence(p11, p12, NC); -Display display(p13, p14); -ControllerManager controllerManager(p8,p15,p16); -Trim trim(p17, p18); -ServoManager servoManager(p21, p22); -DigitalOut resetSw(p26); -XBee xbee(p28, p27); -Airspeed airspeed(p29, NC, NC);//p19,p20をinterruptに使ってはいけない +Display display(p13, p14);//tx, rx +ControllerManager controllerManager(p15,p16,p17,p18);//ele, rud, eletrimup, eletrimdown +ServoManager servoManager(p21, p22);//ele, rud +DigitalOut wdt(p26); +XBee xbee(p28, p27);//tx, rx +Airspeed airspeed(p29, NC, NC);//p19,p20をInterruptInに使ってはいけない void pc_rx(){ while(pc.readable()==1){ //コマンドモードのon,offはここに入れる char buf = (char)pc.getc(); - Global::queue.put((char*)buf); + Global::initqueue.put((char*)buf); } } @@ -54,10 +54,9 @@ void controlTask(void const *pvParameters){ while(1){ //この中でprintfはしないほうがいいみたい(9600bpsだと遅延が起こります) - trim.update(); controllerManager.update(); servoManager.update(); - resetSw = !resetSw; + wdt = !wdt; Thread::wait(50); } }