找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索

單片機(jī)LED數(shù)碼管顯示數(shù)字及左移程序Proteus仿真(獨(dú)立按鍵)

查看數(shù): 3082 | 評(píng)論數(shù): 3 | 收藏 0
關(guān)燈 | 提示:支持鍵盤翻頁(yè)<-左 右->
    組圖打開中,請(qǐng)稍候......
發(fā)布時(shí)間: 2022-11-28 21:55

正文摘要:

單片機(jī)獨(dú)立按鍵控制LED數(shù)碼管顯示數(shù)字及左移 仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)

回復(fù)

ID:1135525 發(fā)表于 2024-11-5 14:31
U2是什么元件
ID:1135525 發(fā)表于 2024-11-5 10:53
終于找到關(guān)于多個(gè)數(shù)碼管動(dòng)態(tài)顯示的帖子了
ID:1134495 發(fā)表于 2024-11-2 23:48
請(qǐng)問使用矩陣鍵盤的話應(yīng)該怎么改


// 矩陣鍵盤讀取按鍵鍵碼
unsigned char MatrixKey()
{
    unsigned char KeyNumber = 0;

    P1 = 0xFF;
    P1_3 = 0;
    if (P1_7 == 0) {Delay_ms(20); while (P1_7 == 0); Delay_ms(20); KeyNumber = 16;}
    if (P1_6 == 0) {Delay_ms(20); while (P1_6 == 0); Delay_ms(20); KeyNumber = 15;}
    if (P1_5 == 0) {Delay_ms(20); while (P1_5 == 0); Delay_ms(20); KeyNumber = 14;}
    if (P1_4 == 0) {Delay_ms(20); while (P1_4 == 0); Delay_ms(20); KeyNumber = 13;}

    P1 = 0xFF;
    P1_2 = 0;
    if (P1_7 == 0) {Delay_ms(20); while (P1_7 == 0); Delay_ms(20); KeyNumber = 12;}
    if (P1_6 == 0) {Delay_ms(20); while (P1_6 == 0); Delay_ms(20); KeyNumber = 11;}
    if (P1_5 == 0) {Delay_ms(20); while (P1_5 == 0); Delay_ms(20); KeyNumber = 10;}
    if (P1_4 == 0) {Delay_ms(20); while (P1_4 == 0); Delay_ms(20); KeyNumber = 9;}

    P1 = 0xFF;
    P1_1 = 0;
    if (P1_7 == 0) {Delay_ms(20); while (P1_7 == 0); Delay_ms(20); KeyNumber = 8;}
    if (P1_6 == 0) {Delay_ms(20); while (P1_6 == 0); Delay_ms(20); KeyNumber = 7;}
    if (P1_5 == 0) {Delay_ms(20); while (P1_5 == 0); Delay_ms(20); KeyNumber = 6;}
    if (P1_4 == 0) {Delay_ms(20); while (P1_4 == 0); Delay_ms(20); KeyNumber = 5;}

    P1 = 0xFF;
    P1_0 = 0;
    if (P1_7 == 0) {Delay_ms(20); while (P1_7 == 0); Delay_ms(20); KeyNumber = 4;}
    if (P1_6 == 0) {Delay_ms(20); while (P1_6 == 0); Delay_ms(20); KeyNumber = 3;}
    if (P1_5 == 0) {Delay_ms(20); while (P1_5 == 0); Delay_ms(20); KeyNumber = 2;}
    if (P1_4 == 0) {Delay_ms(20); while (P1_4 == 0); Delay_ms(20); KeyNumber = 1;}

    return KeyNumber;
}

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表