Main Program
Dependencies: mbed AQM1602 HMC6352 PID
setting/main.h@15:88f2c525caca, 2016-01-09 (annotated)
- Committer:
- lilac0112_1
- Date:
- Sat Jan 09 02:15:46 2016 +0000
- Revision:
- 15:88f2c525caca
- Parent:
- 14:6f214ea5722e
- Child:
- 16:6900f47fa0b5
plan to delete rotarysw
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lilac0112_1 | 14:6f214ea5722e | 1 | #ifndef _MAIN_H_ |
lilac0112_1 | 14:6f214ea5722e | 2 | #define _MAIN_H_ |
lilac0112_1 | 14:6f214ea5722e | 3 | |
lilac0112_1 | 14:6f214ea5722e | 4 | #include "def.h" |
lilac0112_1 | 14:6f214ea5722e | 5 | |
lilac0112_1 | 14:6f214ea5722e | 6 | volatile uint8_t INdata[DATA_NUM]={0}, EXdata[DATA_NUM]={0}; |
lilac0112_1 | 14:6f214ea5722e | 7 | Record data; |
lilac0112_1 | 14:6f214ea5722e | 8 | BusOut LED(LED1); |
lilac0112_1 | 14:6f214ea5722e | 9 | RawSerial pc(SERIAL_TX, SERIAL_RX); |
lilac0112_1 | 14:6f214ea5722e | 10 | RawSerial RN42(D8, D2); |
lilac0112_1 | 14:6f214ea5722e | 11 | AQM1602 Lcd(NC, NC); |
lilac0112_1 | 14:6f214ea5722e | 12 | Timer t; |
lilac0112_1 | 14:6f214ea5722e | 13 | Ticker Duty[DUTY_NUM]; |
lilac0112_1 | 14:6f214ea5722e | 14 | Timeout Stp; |
lilac0112_1 | 14:6f214ea5722e | 15 | |
lilac0112_1 | 14:6f214ea5722e | 16 | MPU6050 mpu(D14, D15); // sda, scl pin |
lilac0112_1 | 14:6f214ea5722e | 17 | InterruptIn INT0(D7); // INT0 pin |
lilac0112_1 | 14:6f214ea5722e | 18 | |
lilac0112_1 | 15:88f2c525caca | 19 | |
lilac0112_1 | 15:88f2c525caca | 20 | //BusIn Sw(NC, NC); |
lilac0112_1 | 15:88f2c525caca | 21 | Pswitch Sw(NC); |
lilac0112_1 | 14:6f214ea5722e | 22 | |
lilac0112_1 | 14:6f214ea5722e | 23 | //Serail for motors |
lilac0112_1 | 14:6f214ea5722e | 24 | string StringFIN; |
lilac0112_1 | 14:6f214ea5722e | 25 | |
lilac0112_1 | 14:6f214ea5722e | 26 | //mouse |
lilac0112_1 | 14:6f214ea5722e | 27 | static PinName const MOSI = D11; |
lilac0112_1 | 14:6f214ea5722e | 28 | static PinName const MISO = D12; |
lilac0112_1 | 14:6f214ea5722e | 29 | static PinName const SCLK = D13; |
lilac0112_1 | 14:6f214ea5722e | 30 | static PinName const NCS = D10; |
lilac0112_1 | 14:6f214ea5722e | 31 | adns_9800 mouse_sensor(MOSI, MISO, SCLK, NCS); |
lilac0112_1 | 14:6f214ea5722e | 32 | |
lilac0112_1 | 14:6f214ea5722e | 33 | |
lilac0112_1 | 14:6f214ea5722e | 34 | //Lcd出力文字(6文字に揃える.) |
lilac0112_1 | 14:6f214ea5722e | 35 | char lcdstr[0x10][0x04][BUFSIZE]={ |
lilac0112_1 | 14:6f214ea5722e | 36 | {{"None "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 37 | {{"Start "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 38 | {{"Debug0"}, {"Ir0 "}, {"Ir1 "}, {"Ir2 "}}, |
lilac0112_1 | 14:6f214ea5722e | 39 | {{"Debug1"}, {"Ping0 "}, {"Mouse0"}, {"Gyro0 "}}, |
lilac0112_1 | 14:6f214ea5722e | 40 | {{"Debug2"}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 41 | {{"Test0 "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 42 | {{"Test1 "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 43 | {{"Test2 "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 44 | {{"Calib0"}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 45 | {{"Calib1"}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 46 | {{"Calib2"}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 47 | {{"Save "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 48 | {{"Store "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 49 | {{"Def0 "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 50 | {{"Att0 "}, {0 }, {0 }, {0 }}, |
lilac0112_1 | 14:6f214ea5722e | 51 | {{"Stop "}, {0 }, {0 }, {0 }} |
lilac0112_1 | 14:6f214ea5722e | 52 | }; |
lilac0112_1 | 14:6f214ea5722e | 53 | double dutycycle[DUTY_NUM] ={//[s] |
lilac0112_1 | 14:6f214ea5722e | 54 | 0.2 |
lilac0112_1 | 14:6f214ea5722e | 55 | }; |
lilac0112_1 | 14:6f214ea5722e | 56 | |
lilac0112_1 | 14:6f214ea5722e | 57 | #endif /*_MAIN_H_*/ |