单片机实现的遥控小汽车的设计研究论文与程序
源代码在线查看: disp.h
////////////////////////////////////////////////////////////////////////
//文件名:disp.h
//功能描述:显示模块头文件
////////////////////////////////////////////////////////////////////////
#include "reg52.h"
#define uchar unsigned char
#define uint unsigned int
////////////////////////////////////////////////////////////////////////
#define TIME_OVERLOAD 3960
#define CHAR_A 10
#define CHAR_b 11
#define CHAR_C 12
#define CHAR_d 13
#define CHAR_E 14
#define CHAR_F 15
#define CHAR_H 16
#define CHAR_J 17
#define CHAR_L 18
#define CHAR_n 19
#define CHAR_P 20
#define CHAR_q 21
#define CHAR_r 22
#define CHAR_U 23
#define CHAR_y 24
#define CHAR_MIE 25
#define LED_DP 0x80
#define LED_SHANSHUO 0x40
//记录时间的结构
typedef struct
{
uchar t_ms;
uchar t_100ms;
uchar t_sec;
uchar t_min;
}TIME;
//数码管显示模式宏定义
//显示时间
#define MODE_TIME 0x00
//显示里程
#define MODE_LICHENG 0x01
//显示用户指定的内容
#define MODE_USER 0x02
extern data uchar led[4];
extern data TIME time;
extern bit LED_DC;
extern bit LED_HZ;
extern bit LED_ZZ;
extern bit LED_SHOUDONG;
extern bit LED_ZIDONG;
extern bit LED_ZOUSHUZI;
extern bit LED_RECORD;
extern bit LED_FEN;
extern bit LED_YZ;
extern bit LED_QZ;
extern bit SSLED_SHOUDONG;
extern bit SSLED_ZIDONG;
extern bit SSLED_ZOUSHUZI;
extern bit SSLED_RECORD;
extern bit SSLED_FEN;
//函数原型声明
extern void init_timer0(void);
extern void resettime(void);
extern unsigned long gettime(void);
extern void delay_ms(uint n);
extern void beep(uchar n);
extern void setdispmode(uchar mode);
extern uchar getdispmode(void);