程序问题试试这个:#include <AT89X51.H>
#include <intrins.h>
//#include <absacc.h>/*--------------------------------------------------*/
sbit dis_DIN=P0^1; //"?????????"
sbit dis_LOAD=P0^2; //"???????"
sbit dis_CLK=P0^3; //"???????"
#define NoOp 0x00 /*???*/
#define Digit0 0x01 /*???1*/
#define Digit1 0x02 /*???2*/
#define Digit2 0x03 /*???3*/
#define Digit3 0x04 /*???4*/
#define Digit4 0x05 /*???5*/
#define Digit5 0x06 /*???6*/
#define Digit6 0x07 /*???7*/
#define Digit7 0x08 /*???8*/
#define DecodeMode 0x09 /*????*/
#define Intensity 0x0a /*??*/
#define ScanLimit 0x0b /*????*/
#define ShutDown 0x0c /*????*/
#define DisplayTest 0x0f /*????*/
#define ShutdownMode 0x00 /*??????*/
#define NormalOperaTIon 0x01 /*??????*/
#define DecodeDigit 0xff /*??????*/
#define IntensityGrade 0x0a /*????????*/
#define ScanDigit 0x07 /*??????*/
#define TestMode 0x01 /*??????*/
#define TextEnd 0x00 /*??????,????*/
unsigned char data DisBuffer[8]={0,0,0,0,0,0,0,0}; /*?????*/
unsigned char code dispaly_list[]=
{
0x7e,0x30,0x6d,0x79,0x33,0x5b,0x5f,0x70,0x7f,0x7b, /*0,1,2,3,4,5,6,7,8,9*/
0x77,0x1f,0x4e,0x3d,0x4f,0x47,0x67,0x3e,0xff,0x00}; /*A,B,C,D,E,F,P,U,?
?,??*/
/*--------------------------------------------------------
10ms?????
---------------------------------------------------------*/
void delayX10ms(unsigned char count)
{
unsigned char j,k;
while(count--!=0)
{
for(j=0;j<43;j++)
for(k=0;k<73;k++)
;
}
}
/*-------------------------------------------------
?MAX7219????(8?)
--------------------------------------------------*/
void SendChar (unsigned char ch)
{
unsigned char i,temp;
_nop_();
for (i=0;i<8;i++)
{
temp=ch&0x80; |