#include #define i unsigned int; #define c unsigned char; ***it wela=P2^7; i x; c num,a; num=0;a=0; c code table[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; void love0(); void main() { TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; EA=1; ET0=1; TR0=1; wela=1; P0=0x00; wela=0; while(1) { if(a==20) { a=0; P0=table[num];num++;if(num==10) num=0; } } } void love0() interrupt 1 { a++; TH0=(65536-50000)/256; TL0=(65536-50000)%256; }
|