http://www.tudou.com/programs/view/VkkhZD-hwcQ/
Version : 1.00
Date : 01.01.2012
Author : xxxxxx
Comments:
Chip type : ATmega32
Program type : Application
Clock frequency : 16,000000 MHz
Memory model : Small
External SRAM size : 0
Data Stack size : 256
*****************************************************/
// includes
#include <mega32.h>
#include <delay.h>
#include <math.h>
#include <stdio.h>
// definitions
#define FIRST_ADC_INPUT 0
#define LAST_ADC_INPUT 6
#define ADC_VREF_TYPE 0x40
#define Drivesumlimit 65000 驱动之限制
#define Overspeedlimit 40000 //
#定义超速限制
2 / 3
的最大驱动速
度
#define total_looptime 2000 //
过滤器的循环时间
#define ADXL_offset -5; //
棒角度偏移
#define ADXL_ZERO 521
#define GYRO_ZERO 510
#define ROCKER_ZERO 512
#define ROCKER_DEADBAND 30
#define ON 1
#define OFF 0
#define Run 1
#define Standby 0 //待机
#define Batt25 664 // AD Value at 25 Volts
#define Batt_low 235 // 23,5 Volt
评论1