Microduino的cube小车。

Dependencies:   mbed-rtos mbed

Committer:
lixianyu
Date:
Sat May 28 05:09:18 2016 +0000
Revision:
4:0670023d3f36
Parent:
3:e4ac7c1a14de
??work????

Who changed what in which revision?

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