CatPot 2015-2016 / Mbed 2 deprecated CatPot_Main_T_2v00

Dependencies:   mbed AQM1602 HMC6352 PID

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

00001 #ifndef _MAIN_H_
00002 #define _MAIN_H_
00003 
00004 #include "def.h"
00005 
00006 //pc(Computer)
00007 RawSerial pc(monitor_tx, monitor_rx);
00008 //led(main)
00009 DigitalOut LED[4]={led1, led2, led3, led4};
00010 //line(bottom)
00011 BusOut LineSignalHolder(lineInA, lineInB, lineInC);
00012 BusIn RawLineSignal(lineA2, lineB2, lineC2);
00013 BusIn HeldLineSignal(lineA1, lineB1, lineC1);
00014 InterruptIn Line[3]={lineA2, lineB2, lineC2};
00015 //ballcheck(bottom)
00016 DigitalIn BallChecker(ballcheck);
00017 //debug_switch(debug_board)
00018 DigitalIn Sw[4] = {selectsw1, selectsw2, debugsw1, debugsw2};
00019 //motor(main)
00020 Serial motor(motor_tx, motor_rx);
00021 //spi(main)
00022 SPI spi(SPI_mosi, SPI_miso, SPI_slck);
00023 DigitalOut spi_ss[4]={SPI_ss_sd, SPI_ss_sonic, SPI_ss_color, SPI_ss_ir};
00024 //bluetooth(debug_board)
00025 RawSerial RN42(blue_rxd, blue_txd);
00026 DigitalOut RN42_Reset(blue_reset);
00027 //lcd(debug_board)
00028 AQM1602 Lcd(lcd_sda, lcd_scl);
00029 //cmps(debug_board)
00030 HMC6352 hmc(sens_sda, sens_scl);
00031 //mouse(bottom)
00032 adns_9800 mouse_sensor(mouse_mosi, mouse_miso, mouse_slck, mouse_ss);
00033 //solenoid(bottom)
00034 DigitalOut kicker(solenoid);
00035 
00036 //Serial for motors
00037 int speed[4]={0};
00038 string StringFIN;
00039 //PID
00040 PID pid(P_GAIN,I_GAIN,D_GAIN, RATE);
00041 Ticker pidupdate;
00042 //for Serial
00043 volatile uint8_t INdata[DATA_NUM]={0}, EXdata[DATA_NUM]={0};
00044 //for DataSet
00045 Record data;
00046 //for transition
00047 Ticker Sw_ticker;
00048 Timeout button;
00049 bool state[4]={0,0,0,0};
00050 uint8_t statesum=0, last_statesum=0;
00051 // for Time
00052 Ticker Motor_ticker;
00053 Ticker Line_ticker;
00054 Ticker Ir_ticker;
00055 Ticker Ping_ticker;
00056 Ticker Solenoid_ticker;
00057 Ticker Hmc_ticker;
00058 Timeout Solenoid_timeout; 
00059 Timeout Line_timeout[3];
00060 Ticker Duty[DUTY_NUM];
00061 Timeout Stp;
00062 double dutycycle[DUTY_NUM] ={//[s]
00063     0.2
00064 };
00065 
00066 #endif /*_MAIN_H_*/