您的位置:首页 > 其它

共阴数码管显示1到15

2016-09-24 18:49 232 查看
//seg.c
#include
#include
#include "delay.h"

#define SEGPORT P0
sbit bit_select = P2^0;
sbit seg_select = P2^1;

unsigned char segdata[16] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};

void main()
{
unsigned char i;
SEGPORT = 0;
bit_select = 1;
bit_select = 0;
for(i = 0; i < 16; i++)
{
SEGPORT = segdata[i];
seg_select = 1;
seg_select = 0;
delay_ms(255);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: