work fine.

Dependencies:   mbed

Committer:
lixianyu
Date:
Thu Jun 02 04:03:31 2016 +0000
Revision:
0:362c1482232c
work fine.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lixianyu 0:362c1482232c 1 //#include <arduino.h>
lixianyu 0:362c1482232c 2 #include "MicroduinoPinNames.h"
lixianyu 0:362c1482232c 3 //#define _DEBUG //DEBUG调试
lixianyu 0:362c1482232c 4
lixianyu 0:362c1482232c 5 #if 0
lixianyu 0:362c1482232c 6 //#define BLE_SoftSerial //软串口模式
lixianyu 0:362c1482232c 7 #ifndef BLE_SoftSerial //如果没开启软串口,就开硬串口模式
lixianyu 0:362c1482232c 8 #if defined(__AVR_ATmega32U4__)
lixianyu 0:362c1482232c 9 #define BLE_HardSerial Serial1
lixianyu 0:362c1482232c 10 #else
lixianyu 0:362c1482232c 11 #define BLE_HardSerial Serial
lixianyu 0:362c1482232c 12 #endif
lixianyu 0:362c1482232c 13 #endif
lixianyu 0:362c1482232c 14 #endif
lixianyu 0:362c1482232c 15
lixianyu 0:362c1482232c 16 #define BLE_SPEED 9600 //蓝牙接口速度
lixianyu 0:362c1482232c 17 #define NRF_CHANNEL 70 //nRF通道
lixianyu 0:362c1482232c 18
lixianyu 0:362c1482232c 19 #define SAFE_TIME_OUT 250 //失控保护时间
lixianyu 0:362c1482232c 20 #define MAX_THROTTLE 255 //最大油门 < 255
lixianyu 0:362c1482232c 21 #define MAX_STEERING 512 //最大转向 < 512
lixianyu 0:362c1482232c 22 #define CHANNEL_THROTTLE 1 //油门通道
lixianyu 0:362c1482232c 23 #define CHANNEL_STEERING 0 //转向通道
lixianyu 0:362c1482232c 24
lixianyu 0:362c1482232c 25 #if defined(__AVR_ATmega32U4__) || (__AVR_ATmega1284P__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega128RFA1__)
lixianyu 0:362c1482232c 26 #define motor_pin0A 8 //PWM
lixianyu 0:362c1482232c 27 #define motor_pin0B 6
lixianyu 0:362c1482232c 28 #define motor_pin1A 7 //PWM
lixianyu 0:362c1482232c 29 #define motor_pin1B 5
lixianyu 0:362c1482232c 30 #define motor_fixL 1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 31 #define motor_fixR 1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 32 #else
lixianyu 0:362c1482232c 33 #if 0
lixianyu 0:362c1482232c 34 #define motor_pin0A D6 //PWM
lixianyu 0:362c1482232c 35 #define motor_pin0B D8
lixianyu 0:362c1482232c 36 #define motor_pin1A D5 //PWM
lixianyu 0:362c1482232c 37 #define motor_pin1B D7
lixianyu 0:362c1482232c 38 #define motor_fixL -1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 39 #define motor_fixR -1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 40 #elif 1
lixianyu 0:362c1482232c 41 #define motor_pin0A D8 //PWM
lixianyu 0:362c1482232c 42 #define motor_pin0B D6
lixianyu 0:362c1482232c 43 #define motor_pin1A D7 //PWM
lixianyu 0:362c1482232c 44 #define motor_pin1B D5
lixianyu 0:362c1482232c 45 #define motor_fixL 1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 46 #define motor_fixR 1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 47 #else
lixianyu 0:362c1482232c 48 #define motor_pin0A D8 //PWM
lixianyu 0:362c1482232c 49 #define motor_pin0B D6
lixianyu 0:362c1482232c 50 #define motor_pin1A D7 //PWM
lixianyu 0:362c1482232c 51 #define motor_pin1B D5
lixianyu 0:362c1482232c 52 #define motor_fixL -1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 53 #define motor_fixR -1 //速度修正 -1到1之间
lixianyu 0:362c1482232c 54 #endif
lixianyu 0:362c1482232c 55 #endif