Main Program

Dependencies:   mbed AQM1602 HMC6352 PID

setting/main.h

Committer:
lilac0112_1
Date:
2016-01-11
Revision:
16:6900f47fa0b5
Parent:
15:88f2c525caca
Child:
17:61edad76efd7

File content as of revision 16:6900f47fa0b5:

#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)
BusIn LineIn(lineInA, lineInB, lineInC);
BusOut LineOut(lineA1, lineA2, lineB1, lineB2, lineC1, lineC2);
//ballcheck(bottom)
DigitalIn BallChecker(ballcheck);
//debug_switch(debug_board)
Pswitch 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 RN42_Reset(blue_reset);
//lcd(debug_board)
AQM1602 Lcd(lcd_sda, lcd_scl);
//gyro(debug_board)
MPU6050 mpu(sens_sda, sens_scl);     // sda, scl pin
InterruptIn INT0(sens_interrupt);     // INT0 pin
//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;
// for Time
Timer t;
Ticker Duty[DUTY_NUM];
Timeout Stp;
double dutycycle[DUTY_NUM] ={//[s]
    0.2
};

#endif /*_MAIN_H_*/