標(biāo)題: 求74hc164控制三位一體的數(shù)碼管 [打印本頁(yè)]

作者: 瘋瘋月    時(shí)間: 2017-7-6 11:42
標(biāo)題: 求74hc164控制三位一體的數(shù)碼管
求74hc164控制三位一體的數(shù)碼管,要求顯示123,另外畫(huà)圖也求指點(diǎn),本人菜手,不想涉及這方面的,可老師逼著我做,求大神幫忙

QQ截圖20170706113928.png (12.56 KB, 下載次數(shù): 64)

QQ截圖20170706113928.png

作者: cjjcjj1    時(shí)間: 2017-7-6 19:47
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽
作者: zmc419    時(shí)間: 2017-7-6 23:14
我用衛(wèi)星接收機(jī)顯示板調(diào)試好的程序,一位顯示數(shù)碼,你改改就能用。 74HC164.rar (13.93 KB, 下載次數(shù): 26)
作者: zmc419    時(shí)間: 2017-7-6 23:15
#include "reg52.h"
#define uint unsigned int
#define uchar unsigned char
sbit DAT=P1^1;
sbit CLK=P1^2;
sbit LED=P1^0;
uchar code tab[]={0x9f,0x25,0x0d,0x99,0x49,0x41,0x1f,0x00,0x09,0xfd,0xff
};//0-9,-,全滅
void sendbyte(uchar byte)
{
uchar num,c;
num=tab[byte];
for(c=0;c<8;c++)
{
CLK=0;
DAT=num&0x01;
CLK=1;
num>>=1;
}
}

void delay_50ms(unsigned int t)
{
unsigned int j;
for(;t>0;t--)
for(j=6245;j>0;j--)
{;}
}
main()
{
unsigned char h;
LED=0;
while(1)
{
for(h=0;h<10;h++)
{
delay_50ms(2);
sendbyte(h);
delay_50ms(40);
}
h=0;
}
}

作者: 5664645345    時(shí)間: 2017-7-7 01:40
好好看下書(shū),很簡(jiǎn)單的





歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1