⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t6963c.c

📁 W78EXX系列单片机编程器制作资料
💻 C
📖 第 1 页 / 共 2 页
字号:
0,0,56,24,24,24,24,24,24,24,24,60,0,0,0,0,
0,0,0,0,0,236,254,214,214,214,214,198,0,0,0,0,
0,0,0,0,0,220,102,102,102,102,102,102,0,0,0,0,
0,0,0,0,0,124,198,198,198,198,198,124,0,0,0,0,
0,0,0,0,0,220,102,102,102,102,102,124,96,96,240,0,
0,0,0,0,0,118,204,204,204,204,204,124,12,12,30,0,
0,0,0,0,0,220,118,102,96,96,96,240,0,0,0,0,
0,0,0,0,0,124,198,96,56,12,198,124,0,0,0,0,
0,0,16,48,48,252,48,48,48,48,54,28,0,0,0,0,
0,0,0,0,0,204,204,204,204,204,204,118,0,0,0,0,
0,0,0,0,0,102,102,102,102,102,60,24,0,0,0,0,
0,0,0,0,0,198,198,214,214,214,254,108,0,0,0,0,
0,0,0,0,0,198,108,56,56,56,108,198,0,0,0,0,
0,0,0,0,0,198,198,198,198,198,198,126,6,12,248,0,
0,0,0,0,0,254,204,24,48,96,198,254,0,0,0,0,
0,0,14,24,24,24,112,24,24,24,24,14,0,0,0,0,
0,0,24,24,24,24,0,24,24,24,24,24,0,0,0,0,
0,0,112,24,24,24,14,24,24,24,24,112,0,0,0,0,
0,0,118,220,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,16,56,108,198,198,198,254,0,0,0,0,0
};

/*	显示8*16点阵英文字母,反白	*/
void da(unsigned char n,bit un) {
	unsigned char i;
	unsigned int k=n;
	for (i=0;i<16;i++) {
		ag(x,y*8+i);
		if (un==0) disp(asc16[k*16+i]); else disp(255-asc16[k*16+i]);
	}
	if ((++x)>=16) {
		x=0;
		y+=2;
		if (y>=8) y=0;
	}
}
/*	反白文本/取消	*/
void da8(unsigned char n,bit un) {
	unsigned char i,j;
	for (j=0;j<n;j++) {
		for (i=0;i<8;i++) {
			ag(x,y*8+i);
			if (un==0) disp(0xff); else disp(0x0);
		}
		if ((++x)>=16) {
			x=0;
			y+=1;
			if (y>=8) y=0;
		}
	}

}

unsigned char code fot[]={
/*0时*/0x0,0x8,0x4,0x8,0x7e,0x8,0x44,0x8,0x47,0xfe,0x44,0x8,0x44,0x8,0x7c,0x88,0x44,0x48,
0x44,0x48,0x44,0x8,0x44,0x8,0x7c,0x8,0x44,0x48,0x0,0x28,0x0,0x10,
/*1间*/0x20,0x4,0x1b,0xfe,0x8,0x4,0x40,0x24,0x4f,0xf4,0x48,0x24,0x48,0x24,0x48,0x24,
0x4f,0xe4,0x48,0x24,0x48,0x24,0x48,0x24,0x4f,0xe4,0x48,0x24,0x40,0x14,0x40,0x8,
/*2日*/0x0,0x10,0x1f,0xf8,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0xf0,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0xf0,0x10,0x10,0x0,0x0,
/*3期*/0x22,0x4,0x22,0x7e,0x22,0x44,0x7f,0x44,0x22,0x44,0x3e,0x7c,0x22,0x44,0x3e,0x44,
0x22,0x44,0x22,0x7c,0xff,0xc4,0x0,0x44,0x24,0x44,0x22,0x84,0x41,0x14,0x82,0x8,
/*4闹*/0x40,0x4,0x37,0xfe,0x10,0x4,0x42,0x4,0x41,0x24,0x5f,0xf4,0x41,0x4,0x41,0x24,
0x4f,0xf4,0x49,0x24,0x49,0x24,0x49,0x24,0x49,0x64,0x41,0x4,0x41,0x14,0x40,0x8,
/*5钟*/0x10,0x20,0x10,0x20,0x10,0x20,0x1c,0x24,0x21,0xfe,0x21,0x24,0x7d,0x24,0x91,0x24,
0x11,0x24,0xfd,0xfc,0x11,0x24,0x10,0x20,0x14,0x20,0x18,0x20,0x10,0x20,0x0,0x20,
/*6设*/0x1,0xf0,0x21,0x10,0x11,0x10,0x11,0x10,0x1,0x10,0x2,0xe,0xf4,0x0,0x13,0xf8,
0x11,0x8,0x11,0x10,0x10,0x90,0x10,0xa0,0x14,0x40,0x18,0xb0,0x13,0xe,0xc,0x4,
/*7定*/0x2,0x0,0x1,0x0,0x7f,0xfe,0x40,0x2,0x80,0x24,0x1f,0xf0,0x1,0x0,0x1,0x0,
0x11,0x20,0x11,0xf0,0x11,0x0,0x11,0x0,0x11,0x0,0x29,0x6,0x47,0xfc,0x80,0x0,
/*8开*/0x0,0x8,0x7f,0xfc,0x8,0x20,0x8,0x20,0x8,0x20,0x8,0x20,0x8,0x24,0xff,0xfe,
0x8,0x20,0x8,0x20,0x8,0x20,0x8,0x20,0x10,0x20,0x10,0x20,0x20,0x20,0x40,0x20,
/*9关*/0x10,0x10,0x8,0x18,0x4,0x20,0x4,0x48,0x7f,0xfc,0x1,0x0,0x1,0x0,0x1,0x4,
0xff,0xfe,0x1,0x0,0x2,0x80,0x2,0x80,0x4,0x40,0x8,0x30,0x30,0xe,0xc0,0x4,
/*10星*/0x0,0x8,0x3f,0xfc,0x20,0x8,0x3f,0xf8,0x20,0x8,0x3f,0xf8,0x1,0x0,0x21,0x8,
0x3f,0xfc,0x21,0x0,0x41,0x10,0xbf,0xf8,0x1,0x0,0x1,0x4,0xff,0xfe,0x0,0x0,
/*11温*/0x0,0x8,0x43,0xfc,0x32,0x8,0x12,0x8,0x83,0xf8,0x62,0x8,0x22,0x8,0xb,0xf8,
0x10,0x0,0x27,0xfc,0xe4,0xa4,0x24,0xa4,0x24,0xa4,0x24,0xa4,0x2f,0xfe,0x20,0x0,
/*12度*/0x1,0x0,0x0,0x84,0x3f,0xfe,0x22,0x20,0x22,0x28,0x3f,0xfc,0x22,0x20,0x23,0xe0,
0x20,0x0,0x2f,0xf0,0x22,0x20,0x21,0x40,0x20,0x80,0x43,0x60,0x8c,0x1e,0x30,0x4,
/*13亮*/0x1,0x8,0x7f,0xfc,0x0,0x10,0x1f,0xf8,0x10,0x10,0x10,0x10,0x1f,0xf0,0x0,0x0,
0x7f,0xfe,0x40,0x22,0x8f,0xf4,0x8,0x20,0x8,0x20,0x8,0x22,0x10,0x22,0x60,0x1e,
/*14湿*/0x0,0x8,0x47,0xfc,0x34,0x8,0x14,0x8,0x87,0xf8,0x64,0x8,0x24,0x8,0xf,0xf8,
0x11,0x20,0x21,0x20,0xe9,0x24,0x25,0x28,0x23,0x30,0x21,0x24,0x3f,0xfe,0x20,0x0,
/*15报*/0x10,0x8,0x11,0xfc,0x11,0x8,0x11,0x8,0xfd,0x28,0x11,0x10,0x15,0x0,0x19,0xf8,
0x31,0x8,0xd1,0x90,0x11,0x50,0x11,0x20,0x11,0x50,0x11,0x8e,0x51,0x4,0x21,0x0,
/*16警*/0x14,0x40,0x7f,0x7c,0x10,0xc8,0x3f,0x28,0x55,0x10,0x1d,0x6e,0x3,0x4,0xff,0xfe,
0x0,0x0,0x1f,0xf0,0x0,0x0,0x1f,0xf0,0x0,0x0,0x1f,0xf0,0x10,0x10,0x1f,0xf0,
/*17火*/0x1,0x0,0x1,0x0,0x1,0x0,0x1,0x0,0x11,0x8,0x11,0x18,0x11,0x20,0x21,0x40,
0x42,0x80,0x2,0x80,0x4,0x40,0x4,0x40,0x8,0x20,0x10,0x10,0x20,0xe,0x40,0x4,
/*18盗*/0x1,0x0,0x41,0x8,0x33,0xfc,0x12,0x48,0x4,0x40,0x10,0xa0,0x21,0x10,0xc6,0xe,
0x40,0x4,0x1f,0xf0,0x12,0x90,0x12,0x90,0x12,0x90,0x12,0x94,0xff,0xfe,0x0,0x0,
/*19煤*/0x21,0x10,0x21,0x10,0x21,0x10,0x27,0xfc,0xf9,0x10,0x49,0xf0,0x49,0x10,0x49,0xf0,
0x48,0x44,0x8f,0xfe,0x50,0x40,0x20,0xe0,0x51,0x50,0x4a,0x4e,0x84,0x44,0x0,0x40,
/*20气*/0x10,0x0,0x10,0x8,0x1f,0xfc,0x20,0x0,0x2f,0xf0,0x40,0x0,0xbf,0xe0,0x0,0x20,
0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x22,0x0,0x12,0x0,0xa,0x0,0x53,
/*21紧*/0x4,0x0,0x25,0xf8,0x25,0x10,0x24,0xa0,0x24,0x40,0x24,0xb0,0x7,0xe,0x4,0x24,
0x1f,0xc0,0x1,0x0,0x2,0x10,0x7f,0xf8,0x1,0x8,0x9,0x20,0x11,0x18,0x63,0x8,
/*22急*/0x4,0x0,0x4,0x0,0xf,0xe0,0x8,0x40,0x10,0x88,0x3f,0xfc,0x40,0x8,0x1f,0xf8,
0x0,0x8,0x3f,0xf8,0x2,0x0,0x51,0x84,0x50,0x92,0x90,0x12,0xf,0xf0,0x0,0x0,
/*23电*/0x2,0x0,0x2,0x0,0x2,0x10,0x7f,0xf8,0x42,0x10,0x42,0x10,0x7f,0xf0,0x42,0x10,
0x42,0x10,0x7f,0xf0,0x42,0x10,0x2,0x0,0x2,0x4,0x2,0x4,0x1,0xfc,0x0,0x0,
/*24话*/0x0,0x10,0x40,0x38,0x33,0xc0,0x10,0x40,0x0,0x40,0x0,0x44,0xf7,0xfe,0x10,0x40,
0x10,0x48,0x13,0xfc,0x12,0x8,0x12,0x8,0x16,0x8,0x1a,0x8,0x13,0xf8,0x2,0x8};

/*	显示16*16点阵汉字,反白	*/
void dh(unsigned char n,bit un) {
	unsigned char i,j;
	unsigned int k=n;
	for (i=0;i<16;i++) {
		for (j=0;j<2;j++) {
			ag(j+x,y*8+i);
			if (un==0) disp(fot[k*32+i*2+j]); else disp(255-fot[k*32+i*2+j]);
		}
	}
	x+=2;
	if (x>=16) {
		x=0;
		y+=2;
		if (y>=8) y=0;
	}
}

/*	划线	*/
void line(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1) {
	unsigned char x=x1-x0,y=y1-y0,xx,temp;
	float yy;
	if (x>y) {
		yy=y0;
		for (xx=x0;xx<x1;xx++) {
			yy+=(float)y/x;
			ag((xx/8),yy);
			setb((7-xx&7));
		}
	} else {
		yy=x0;
		for (xx=y0;xx<y1;xx++) {
			yy+=(float)x/y;
			ag(yy/8,xx);
			setb((7-(char)yy&7));
		}
	}
}



//==============================================
unsigned char kpush;
unsigned char code key[]={0,237,221,189,125,231,215,183,119,
				238,222,190,126,235,219,187,123};

void scankey(void) {
	unsigned char lie,knew=0;
	P1=0xf;
	if ((P1&0xf)!=0xf) {
		wait10();
		if ((lie=P1&0xf)!=0xf) {
			P1=0xf0;
			knew=P1&0xf0|lie;
		} 
	}	
	for (lie=0;lie<17;lie++) {
		if (knew==key[lie]) break;
	}
	kpush=lie;
}


/*	定时器0中断	*/
unsigned char s,m,h;
unsigned int s001;
void int_t0(void) interrupt 1 {
	TL0+=48;TH0=0xf8;
	time++;
	if ((++s001)>=1000) {
		s001=0;
		if ((++s)>59) {
			s=0;
			if ((++m)>59) {
				m=0;
				if ((++h)>23) h=0;
			}
		}
	}
}

/*	定时器1中断,现用于lcd负压	*/
/*	该部分线路图整理中*/
void int_t1(void) interrupt 3 {
	P3=P3^0xc0;
}




void main(void) {
	unsigned char i,j;
	TMOD=0x21;
	TH1=0;PT0=1;
	P3=0x7f;
	EA=1;
	ET0=1;TR0=1;
	ET1=1;TR1=1;	
	init();

	
	dh(10,0);
	dh(3,0);
	da(' ',0);
	da('1',0);

	at(7,0);
	disp('1'-0x20);
	disp('2'-0x20);
	disp(':'-0x20);
	disp('5'-0x20);
	disp('9'-0x20);
	disp(' '-0x20);
	disp('o'-0x20);
	disp('n'-0x20);

	at(7,1);
	disp('1'-0x20);
	disp('2'-0x20);
	disp(':'-0x20);
	disp('5'-0x20);
	disp('9'-0x20);
	disp(' '-0x20);
	disp('o'-0x20);
	disp('f'-0x20);
	disp('f'-0x20);

	line(53,0,53,18);
	line(0,18,128,18);


	x=0;y=3;
	dh(0,0);
	dh(1,0);
	
	x=0;y=6;
	dh(2,0);
	dh(3,0);
	da(' ',0);
	da('1',0);
	da('9',0);
	da('9',0);
	da('8',0);
	da('-',0);
	da('1',0);
	da('2',0);
	da('-',0);
	da('2',0);
	da('9',0);
	
//	for (i=0;i<128;i++) {
//		da(i,i%16,i/16*2);
//	}

//	while (1) {}

//	at(0,2);
//	for (i=0;i<16;i++) disp('='-0x20);


//	for (i=0;i<8;i++) {
//		dh(i,i*2,0);
//		dh(i+8,i*2,2);
//		dh(i+16,i*2,4);
//		dh(i+24,i*2,6);
//	}

//	while (1) {}

	x=13;
	y=1;
	da8(3,0);

	while (1) {
		scankey();
		if (kpush==1) {
			x=0;y=0;
			dh(10,1);
			dh(3,1);
		} else if (kpush==2) {
			x=0;y=3;
			dh(0,1);
			dh(1,1);
		}
		x=6;y=3;
		da(h/10+0x30,0);
		da(h%10+0x30,0);
		da(':',0);
		da(m/10+0x30,0);
		da(m%10+0x30,0);
		da(':',0);
		da(s/10+0x30,0);
		da(s%10+0x30,0);
	}

}	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -