单片机:一位数码管显示
#include<reg51.h> void main( ) { unsigned char x=1,y=2; unsigned char seg[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; while(1) { P0=seg[x]; P2=seg[y]; } }
#include<reg51.h> void main( ) { unsigned char x=1,y=2; unsigned char seg[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; while(1) { P0=seg[x]; P2=seg[y]; } }