哪位大侠帮我弄几个头文件#include <mega32.h> #include <delay.h> #include <math.h> #include <stdio.h> 30
//includes#include<mega32.h>#include<delay.h>#include<math.h>#include<stdio.h>//defin...
// 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 of max drive speed
#define total_looptime 2000 // Looptime for filters
#define ADXL_offset -5; // Stick Angle offset
#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
#define max_PWM 250 // The MOSFET Driver must have a little pulse for Operation
#define PWM_A OCR1AL
#define PWM_B OCR1BL
#define AD_GYRO adc_data[2]
#define AD_ADXL adc_data[0]
#define AD_ROCKER adc_data[5]
#define AD_Batt adc_data[6]
#define CW_CCW_A PORTD.6
#define CW_CCW_B PORTD.7
#define LED1 PORTC.2
#define LED2 PORTC.3
#define BUZZER PORTC.1
// global variables
unsigned int Voltage=0;
unsigned char MODE=0;
signed long total_ADXL_GYRO=0;
signed long Average_Gyro=0;
signed int DriveA=0;
signed int DriveB=0;
signed long buf1=0;
signed int buf=0;
signed int buf2=0;
signed long Average_Batt=total_looptime*Batt25;
signed int Tilt_ANGLE=0;
signed int Drive_A=0;
signed int Drive_B=0;
signed int Drivespeed=0;
signed int Steeringsignal=0;
signed long Anglecorrection=0;
signed int Angle_Rate=0;
signed long Balance_moment=0;
signed long Drive_sum=0;
signed long Overspeed=0;
signed long Overspeed_integral=0;
bit Overspeed_flag=0;
bit Batt_low_flag=0;
unsigned char intervalz=0;
unsigned char interval=0;
unsigned int adc_data[LAST_ADC_INPUT-FIRST_ADC_INPUT+1];
interrupt [ADC_INT]
/* 展开
#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 of max drive speed
#define total_looptime 2000 // Looptime for filters
#define ADXL_offset -5; // Stick Angle offset
#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
#define max_PWM 250 // The MOSFET Driver must have a little pulse for Operation
#define PWM_A OCR1AL
#define PWM_B OCR1BL
#define AD_GYRO adc_data[2]
#define AD_ADXL adc_data[0]
#define AD_ROCKER adc_data[5]
#define AD_Batt adc_data[6]
#define CW_CCW_A PORTD.6
#define CW_CCW_B PORTD.7
#define LED1 PORTC.2
#define LED2 PORTC.3
#define BUZZER PORTC.1
// global variables
unsigned int Voltage=0;
unsigned char MODE=0;
signed long total_ADXL_GYRO=0;
signed long Average_Gyro=0;
signed int DriveA=0;
signed int DriveB=0;
signed long buf1=0;
signed int buf=0;
signed int buf2=0;
signed long Average_Batt=total_looptime*Batt25;
signed int Tilt_ANGLE=0;
signed int Drive_A=0;
signed int Drive_B=0;
signed int Drivespeed=0;
signed int Steeringsignal=0;
signed long Anglecorrection=0;
signed int Angle_Rate=0;
signed long Balance_moment=0;
signed long Drive_sum=0;
signed long Overspeed=0;
signed long Overspeed_integral=0;
bit Overspeed_flag=0;
bit Batt_low_flag=0;
unsigned char intervalz=0;
unsigned char interval=0;
unsigned int adc_data[LAST_ADC_INPUT-FIRST_ADC_INPUT+1];
interrupt [ADC_INT]
/* 展开
3个回答
展开全部
你使用的是神马编译器,在神马环境下运行的?
追问
ICC AVR win7系统
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
都不知道你说些什么啊
追问
网上找来一个源代码,运行一下后发现少了
mega32.h delay.h math.h stdio.h
这几个头文件,不知能否帮忙,我是刚开始学,不知道怎么编制。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
表示不明白你要干什么啊。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询