ジャパンオープン用のメインプログラム

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
0:ea35c18c85fc
Child:
2:635947de1583
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setting/main.h	Sat Feb 27 09:14:37 2016 +0000
@@ -0,0 +1,72 @@
+#ifndef _MAIN_H_
+#define _MAIN_H_
+
+#include "def.h"
+
+//pc(Computer)
+RawSerial pc(monitor_tx, monitor_rx);
+//led(main)
+DigitalOut LED[4]={led1, led2, led3, led4};
+//line(bottom)
+BusOut LineSignalHolder(lineInA, lineInB, lineInC);
+BusIn RawLineSignal(lineA2, lineB2, lineC2);
+BusIn HeldLineSignal(lineA1, lineB1, lineC1);
+InterruptIn Line[3]={lineA2, lineB2, lineC2};
+//ballcheck(bottom)
+DigitalIn BallChecker(ballcheck);
+AnalogIn BallCheckerA(ballcheck);
+//debug_switch(debug_board)
+DigitalIn Sw[4] = {selectsw1, selectsw2, debugsw1, debugsw2};
+//motor(main)
+Serial motor(motor_tx, motor_rx);
+//spi(main)
+SPI spi(SPI_mosi, SPI_miso, SPI_slck);
+DigitalOut spi_ss[4]={SPI_ss_sd, SPI_ss_sonic, SPI_ss_color, SPI_ss_ir};
+//bluetooth(debug_board)
+RawSerial RN42(blue_rxd, blue_txd);
+DigitalOut hmc_reset(blue_reset);
+//lcd(debug_board)
+AQM1602 Lcd(lcd_sda, lcd_scl);
+//cmps(debug_board)
+HMC6352 hmc(sens_sda, sens_scl);
+//mouse(bottom)
+adns_9800 mouse_sensor(mouse_mosi, mouse_miso, mouse_slck, mouse_ss);
+//solenoid(bottom)
+DigitalOut kicker(solenoid);
+
+//Serial for motors
+int speed[4]={0};
+string StringFIN;
+//PID
+PID pid(P_GAIN,I_GAIN,D_GAIN, RATE);
+Ticker pidupdate;
+//for Serial
+volatile uint8_t INdata[DATA_NUM]={0}, EXdata[DATA_NUM]={0};
+//for DataSet
+//Record data;
+//NewStruct
+CompassVal cmps_set;
+SensorVal data_set;
+LineVal line_set;
+SystemVal sys;
+//for transition
+Ticker Sw_ticker;
+Timeout button;
+bool state[4]={0,0,0,0};
+uint8_t statesum=0, last_statesum=0;
+// for Time
+Ticker Motor_ticker;
+Ticker Line_ticker;
+Ticker Ir_ticker;
+Ticker Ping_ticker;
+Ticker Solenoid_ticker;
+Ticker Hmc_ticker;
+Timeout Solenoid_timeout; 
+Timeout Line_timeout[3];
+Ticker Duty[DUTY_NUM];
+Timeout Stp;
+double dutycycle[DUTY_NUM] ={//[s]
+    0.2
+};
+
+#endif /*_MAIN_H_*/
\ No newline at end of file