Microduino的cube小车。

Dependencies:   mbed-rtos mbed

Committer:
lixianyu
Date:
Wed May 25 11:52:03 2016 +0000
Revision:
1:758ccab13947
Child:
3:e4ac7c1a14de
??????

Who changed what in which revision?

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