求指点- 为什么输出的数字是反向的
时间:10-02
整理:3721RD
点击:
为什么输出的数字是反向的
#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char
#define sled_wm_port P2
#define sled_dm_port P0
sbit sled_en_port=P3^6;
uchar temp,shi,ge;
uchar code tabledm[]={0xc0,0xf9,0xa4,0xb0,0x99,
0x92,0x82,0xf8,0x80,0x90,
0x88,0x83,0xc6,0xa1,0x86,0x8e};
//void delay(uint z);
void main()
{
while(1)
{
temp=15;
shi=temp/10;
ge=temp%10;
sled_en_port=1;
sled_dm_port=tabledm[shi];
P0=0xff;
sled_wm_port=0xfe;
sled_en_port=0;
P0=0xff;
sled_en_port=1;
sled_dm_port=tabledm[ge];
P0=0xff;
sled_wm_port=0xfd;
sled_en_port=0;
}
#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char
#define sled_wm_port P2
#define sled_dm_port P0
sbit sled_en_port=P3^6;
uchar temp,shi,ge;
uchar code tabledm[]={0xc0,0xf9,0xa4,0xb0,0x99,
0x92,0x82,0xf8,0x80,0x90,
0x88,0x83,0xc6,0xa1,0x86,0x8e};
//void delay(uint z);
void main()
{
while(1)
{
temp=15;
shi=temp/10;
ge=temp%10;
sled_en_port=1;
sled_dm_port=tabledm[shi];
P0=0xff;
sled_wm_port=0xfe;
sled_en_port=0;
P0=0xff;
sled_en_port=1;
sled_dm_port=tabledm[ge];
P0=0xff;
sled_wm_port=0xfd;
sled_en_port=0;
}