51單片機數位管字元H自右向左移動

來源:互聯網
上載者:User

標籤:signed   display   for   i++   gpo   51單片機   sign   nbsp   pre   

#include <reg51.h>#define uint unsigned int #define uchar unsigned charsfr P0M0 = 0x94;sfr P0M1 = 0x93;sfr P2M0 = 0x96;sfr P2M1 = 0x95;uint count;uchar code leddata[] = {                0xC0,  //"0"                0xF9,  //"1"                0xA4,  //"2"                0xB0,  //"3"                0x99,  //"4"                0x92,  //"5"                0x82,  //"6"                0xF8,  //"7"                0x80,  //"8"                0x90,  //"9"                0x88,  //"A"                0x83,  //"B"                0xC6,  //"C"                0xA1,  //"D"                0x86,  //"E"                0x8E,  //"F"                0x89,  //"H"                0xC7,  //"L"                0xC8,  //"n"                0xC1,  //"u"                0x8C,  //"P"                0xA3,  //"o"                0xBF,  //"-"                0xFF,  };uchar code weidata[] = {    0x01,0x02,0x04,0x08,    0x10,0x20,0x40,0x80,    0x01,0x02,0x04,0x08,    0x10,0x20,0x40,0x80};void delay(uint ms){    uint i,j;    for(i = 0;i < ms;i++)        for(j = 0;j < 121;j++);}void display(){    uint i;    for(i = 0;i < 16;i++){        P0 = leddata[16];        P2 = ~weidata[i];        delay(1000);    }}void main(){    P0M0 = 0x00;    P0M1 = 0x00;    P2M0 = 0x00;    P2M1 = 0x00;    while(1){        display();    }}

 

51單片機數位管字元H自右向左移動

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.