標題: 單片機LED顯示生日 [打印本頁]

作者: 873932511    時間: 2019-5-4 23:09
標題: 單片機LED顯示生日
LED顯示生日.zip (20.87 KB, 下載次數(shù): 7)


  1. #include<reg51.h>
  2. #include<intrins.h>
  3. #define uchar unsigned char
  4. #define uint unsigned int
  5. uchar code dis_code[]={0xf9,0x90,0x90,0x90,0xc0,0xf9,0xc0,0xb0,0x90,0x88,0xc0};//顯示數(shù)字
  6. void  delay(uint t)
  7. {
  8. uchar i;
  9. while(t--) for(i=0;i<200;i++);
  10. }
  11. void  main()
  12. {
  13. uchar i,j=0x80;
  14.       while(1)
  15.      {
  16. for(i=0;i<8;i++)
  17. {
  18.         j=_crol_(j,1);
  19.         P0=dis_code[i];
  20.         P2=j;
  21.         delay(180);
  22. }
  23.        }
  24. }
復(fù)制代碼



作者: admin    時間: 2019-5-5 03:02
本帖需要重新編輯補全電路原理圖,源碼,詳細說明與圖片即可獲得100+黑幣(帖子下方有編輯按鈕)
作者: zctwss321    時間: 2019-5-5 13:49
大哥,你這到底是什么led啊?是不是8x8led點陣啊?
作者: zctwss321    時間: 2019-5-5 13:51
對了,你那個P2是不是位選?




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