怎样编写单片机四位数码管输出1234四位数
#include #include/***************************************************************************** 显示数据编码的、符号常量等的定义*****************************************************************************/#define uchar unsigned char#define uint unsigned intuchar code SEG7[10]={0X3F,0X06,0X5B,0X4F,0X66,0X6D,0...全部
#include #include/***************************************************************************** 显示数据编码的、符号常量等的定义*****************************************************************************/#define uchar unsigned char#define uint unsigned intuchar code SEG7[10]={0X3F,0X06,0X5B,0X4F,0X66,0X6D,0X7D,0X07,0X7F,0X6F};//定义0~9的编码uchar code Scan_bit[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf}; //定义扫描位控制码uchar data Dis_buf[]={1,2,3,4,5,6}; //定义显示缓冲区,并赋值/***************************************************************************** function:delayms(uint t) 功 能:延时程序,系统时钟为11。
0592MHZ,延时时间为t毫秒*****************************************************************************/void delayms(uint t){uchar i,j;for(i=0;i这个是intrins。
h;一般系统会有,/*--------------------------------------------------------------------------INTRINS。HIntrinsic functions for C51。
Copyright (c) 1988-2004 Keil Elektronik GmbH and Keil Software, Inc。All rights reserved。
--------------------------------------------------------------------------*/#ifndef __INTRINS_H__#define __INTRINS_H__extern void _nop_ (void);extern bit _testbit_ (bit);extern unsigned char _cror_ (unsigned char, unsigned char);extern unsigned int _iror_ (unsigned int, unsigned char);extern unsigned long _lror_ (unsigned long, unsigned char);extern unsigned char _crol_ (unsigned char, unsigned char);extern unsigned int _irol_ (unsigned int, unsigned char);extern unsigned long _lrol_ (unsigned long, unsigned char);extern unsigned char _chkfloat_(float);extern void _push_ (unsigned char _sfr);extern void _pop_ (unsigned char _sfr);#endif。收起