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.
Fork of TVDctrller2017_brdRev1_ver6 by
Diff: main.cpp
- Revision:
- 19:571a4d00b89c
- Parent:
- 14:7cc98e159c6e
- Child:
- 20:3c5061281a7a
diff -r b7c362c8f0fd -r 571a4d00b89c main.cpp --- a/main.cpp Wed Aug 10 11:21:47 2016 +0000 +++ b/main.cpp Wed Aug 17 14:17:14 2016 +0000 @@ -8,28 +8,26 @@ //////////////////////////////////////// //IO宣言 SPI spi(p5,p6,p7); -MCP4922 mcp(p5,p7,p8); // MOSI, SCLK, CS -Serial com2(p9, p10); //xbeeとかデバッグ用 -DigitalOut cs(p11); -//12 -//13 -//14 +MCP4922 mcp(p5,p7,p9); // MOSI, SCLK, CS +DigitalOut cs(p8); +DigitalIn SDState(p10); +DigitalIn RTDSW(p11); +DigitalIn SLCTSW[3] = {p12, p13, p14}; InterruptIn rightMotorPulse(p15); InterruptIn leftMotorPulse(p16); AnalogIn brake(p17); -AnalogOut ana(p18); +AnalogOut STR2AN(p18); AnalogIn apsS(p19); //"S"econdary AnalogIn apsP(p20); //"P"rimary -DigitalOut indicatorLed(p21); -DigitalOut shutDown(p22); -DigitalOut MotorPulse[] = {p23, p24}; -DigitalIn RTDSW(p25); -DigitalIn SDState(p26); -Serial com1(p28, p27); //インパネとの通信に使用するかも知れなくもないかもしれない +DigitalOut shutDown(p21); +DigitalOut indicatorLed(p22); +DigitalOut WDT(p23); +DigitalOut DBGLED[3] = {p24, p25, p26}; +DigitalOut RSV(p27); //予約ピン +Serial ComInpn(p28, NC); +CAN can(p30, p29); DigitalOut LED[] = {LED1, LED2, LED3, LED4}; -//DigitalOut watchDog(); -CAN can(p30, p29); #define indicateSystem(x) (indicatorLed.write(x)) #define shutdownSystem(void) (shutDown.write(0)) @@ -54,6 +52,7 @@ int main(void) { + int f_whatchdog=0; pc.baud(115200); printf("\r\nVersion:TVDcontrol_BETA...start!!!!!\r\n"); @@ -72,6 +71,8 @@ struct errCounter_t eCounter= {0,0,0,0,0,0,0,0}; while(1) { + f_whatchdog = ~f_whatchdog; + WDT.write(f_whatchdog); //getCurrentErrCount(&eCounter); timer.reset();