久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 13882|回復(fù): 22
打印 上一主題 下一主題
收起左側(cè)

51單片機計步器Proteus仿真和源程序 基于MAX7219

  [復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:115111 發(fā)表于 2016-5-10 22:56 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
單片機max7219計步器仿真圖 原理圖






計步器的所有仿真和源碼下載: 計步器Proteus仿真和源程序.rar (85.34 KB, 下載次數(shù): 389)

如果需要基于adxl345加速度 計步器程序在這里: http://www.zg4o1577.cn/bbs/dpj-50085-1.html
下面是部分源碼預(yù)覽:
  1. #include "reg51.h"

  2. #define uint unsigned int
  3. #define uchar unsigned char

  4. sbit DIN = P1^0;
  5. sbit CLK = P1^1;
  6. sbit LOAD = P1^2;
  7. sbit StartKey = P1^3;
  8. sbit StopKey = P1^4;
  9. sbit StepKey = P1^5;

  10. uchar StartFlag=0;



  11. #define NoOp 0x00
  12. #define Digit0 0x01
  13. #define Digit1 0x02
  14. #define Digit2 0x03
  15. #define Digit3 0x04
  16. #define Digit4 0x05
  17. #define Digit5 0x06
  18. #define Digit6 0x07
  19. #define Digit7 0x08
  20. #define DecodeMode 0x09
  21. #define Intensity 0x0a
  22. #define ScanLimit 0x0b
  23. #define ShutDown 0x0c
  24. #define DisplayTest 0x0f

  25. #define ShutdownMode 0x00
  26. #define NormalOperation 0x01

  27. #define ScanDigit 0x07
  28. #define DecodeDigit 0xff
  29. #define IntensityGrade 0x0a

  30. #define TestMode 0x01
  31. #define TextEnd 0x00

  32. uchar DisBuffer[8]= {0,0,0,0,0,0,0,0};

  33. void delay(uint t)
  34. {
  35.         uint i;
  36.         while(t--)
  37.         {
  38.                 for(i=0; i<8; i++);
  39.         }
  40. }

  41. void SendChar(uchar ch)
  42. {
  43.         uchar i,temp;
  44. //        _nop_();
  45.         for(i=0; i<8; i++)
  46.         {
  47.                 temp=ch&0x80;
  48.                 ch=ch<<1;
  49.                 if(temp)
  50.                 {
  51.                         DIN=1;
  52.                         CLK=0;
  53.                         CLK=1;
  54.                 }
  55.                 else
  56.                 {
  57.                         DIN=0;
  58.                         CLK=0;
  59.                         CLK=1;
  60.                 }
  61.         }
  62. }

  63. void WriteWord(uchar addr,uchar num)
  64. {
  65.         LOAD=0;
  66. //        _nop_();
  67.         SendChar(addr);
  68. //        _nop_();
  69.         SendChar(num);
  70. //        _nop_();
  71.         LOAD=1;
  72. }

  73. void InitDisplay()
  74. {
  75.         WriteWord(ScanLimit,ScanDigit);
  76.         WriteWord(DecodeMode,DecodeDigit);
  77.         WriteWord(Intensity,IntensityGrade);
  78.         WriteWord(ShutDown,NormalOperation);
  79. }

  80. void main()
  81. {
  82.         unsigned long StepCount = 0;
  83.         uchar i;
  84.         InitDisplay();
  85.         WriteWord(DisplayTest,TestMode);
  86.         delay(3000);
  87.         WriteWord(DisplayTest,TextEnd);

  88.         while(1)
  89.         {
  90.                 if(StartKey == 0)
  91.                 {
  92.                         delay(100);
  93.                         if(StartKey == 0)
  94.                         {
  95.                                 StartFlag = 1;
  96.                                 for(i = 0;i < 8;i++)
  97.                                 {
  98.                                         WriteWord(Digit0+i,0);
  99.                                 }
  100.                         }
  101.                         while(!StartKey);
  102.                 }
  103.                 else if(StopKey == 0)
  104.                 {
  105.                         delay(100);
  106.                          if(StopKey == 0)
  107.                          {
  108.                                 StartFlag = 0;
  109.                          }
  110.                          while(!StopKey);
  111.                 }

  112.                 if(StartFlag)
  113.                 {
  114.                         if(StepKey == 0)
  115.                         {
  116.                                 delay(100);
  117.                                 if(StepKey == 0)
  118.                                 {
  119.                                         StepCount++;
  120.                                 }
  121.                                 while(!StepKey);
  122.                         }
  123.                 }
  124.                
  125.                 WriteWord(Digit7,StepCount%10);
  126.                 WriteWord(Digit6,StepCount/10%10);
  127.                 WriteWord(Digit5,StepCount/100%10);
  128.                 WriteWord(Digit4,StepCount/1000%10);
  129.                 WriteWord(Digit3,StepCount/10000%10);
  130.                 WriteWord(Digit2,StepCount/100000%10);
  131.                 WriteWord(Digit1,StepCount/1000000%10);
  132.                 WriteWord(Digit0,StepCount/10000000%10);


  133.         }
  134. }

復(fù)制代碼



評分

參與人數(shù) 1黑幣 +5 收起 理由
兜蔸竇 + 5 很給力!

查看全部評分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏9 分享淘帖 頂 踩
回復(fù)

使用道具 舉報

沙發(fā)
ID:140197 發(fā)表于 2016-9-23 11:06 | 只看該作者
學(xué)習(xí)一下
回復(fù)

使用道具 舉報

板凳
ID:141382 發(fā)表于 2016-10-6 01:39 | 只看該作者
學(xué)習(xí)了
回復(fù)

使用道具 舉報

地板
ID:143128 發(fā)表于 2016-10-19 18:50 | 只看該作者
只可以顯示步數(shù)? 仿真的時候怎樣讓他可以加步數(shù),你做過實物出來了嗎

回復(fù)

使用道具 舉報

5#
ID:146464 發(fā)表于 2016-11-7 21:20 | 只看該作者
可以喔!
回復(fù)

使用道具 舉報

6#
ID:147464 發(fā)表于 2016-11-17 09:53 | 只看該作者
學(xué)習(xí)學(xué)習(xí)
回復(fù)

使用道具 舉報

7#
ID:150971 發(fā)表于 2016-11-29 14:18 | 只看該作者
怎么沒有ADSL345的仿真?
回復(fù)

使用道具 舉報

8#
ID:151085 發(fā)表于 2016-11-29 20:01 | 只看該作者
很厲害,學(xué)習(xí)了
回復(fù)

使用道具 舉報

9#
ID:159974 發(fā)表于 2017-1-6 22:53 | 只看該作者
感覺好厲害
回復(fù)

使用道具 舉報

10#
ID:197695 發(fā)表于 2017-5-7 14:26 | 只看該作者
仿真的時候顯示步數(shù)嗎?
回復(fù)

使用道具 舉報

11#
ID:204636 發(fā)表于 2017-5-25 17:13 | 只看該作者
按鍵好像沒用啊,啟動不了
回復(fù)

使用道具 舉報

12#
ID:211227 發(fā)表于 2017-6-14 17:13 | 只看該作者
非常好!
回復(fù)

使用道具 舉報

13#
ID:211258 發(fā)表于 2017-6-14 23:04 | 只看該作者
很厲害,學(xué)習(xí)了
回復(fù)

使用道具 舉報

14#
ID:211258 發(fā)表于 2017-6-15 17:16 | 只看該作者
謝謝分享!收藏了!
回復(fù)

使用道具 舉報

15#
ID:213903 發(fā)表于 2017-6-23 00:38 | 只看該作者
學(xué)習(xí)了!
回復(fù)

使用道具 舉報

16#
ID:33848 發(fā)表于 2017-6-30 10:31 | 只看該作者
厲害了,學(xué)學(xué)
回復(fù)

使用道具 舉報

17#
ID:257406 發(fā)表于 2017-12-4 22:22 | 只看該作者
求問你的這些程序?qū)崿F(xiàn)的有哪些功能?
回復(fù)

使用道具 舉報

18#
ID:208643 發(fā)表于 2018-8-8 17:23 | 只看該作者
學(xué)習(xí)學(xué)習(xí),謝謝分享
回復(fù)

使用道具 舉報

19#
ID:92810 發(fā)表于 2019-5-27 10:51 | 只看該作者
謝謝分享了,學(xué)習(xí)了
回復(fù)

使用道具 舉報

20#
ID:565777 發(fā)表于 2019-6-18 15:21 | 只看該作者
想學(xué)習(xí)一下大神的做法
回復(fù)

使用道具 舉報

21#
ID:575213 發(fā)表于 2019-7-1 18:38 | 只看該作者
我的怎么不顯示啊   著急啊
回復(fù)

使用道具 舉報

22#
ID:729922 發(fā)表于 2020-4-15 18:35 | 只看該作者
aa864894787 發(fā)表于 2019-7-1 18:38
我的怎么不顯示啊   著急啊

我也是導(dǎo)入了程序,但是不顯示,你弄出來了嗎
回復(fù)

使用道具 舉報

23#
ID:848824 發(fā)表于 2022-1-13 14:49 | 只看該作者
非常好用感謝分享
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

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

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

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 亚洲欧美日韩精品久久亚洲区 | 91原创视频| 久久99精品久久久久 | 日本三级日产三级国产三级 | 狠狠爱一区二区三区 | 美美女高清毛片视频免费观看 | 国产精品久久久久影院色老大 | 国产在线视频一区二区 | 91精品国产综合久久久久久 | 一区二区三区在线观看视频 | 欧美一区二区三区久久精品 | 亚洲欧美自拍偷拍视频 | 国产国拍亚洲精品av | 久久大陆 | 日韩在线一区二区 | 精品影视| 亚洲成人av在线播放 | www.天堂av.com | 国产福利在线 | 久久久久国产 | av黄色免费 | 蜜桃五月天 | 天天干视频在线 | 欧美精品久久 | 日本视频在线播放 | 日韩黄色小视频 | 久草福利| 国产一级大片 | 午夜视频免费在线观看 | 色综合久久88色综合天天 | 久久国产区| 中文字幕一区二区三区四区五区 | 国产精品久久久久久亚洲调教 | 国内精品久久久久 | 国产亚洲精品区 | 国产乱码精品1区2区3区 | 亚洲中字在线 | 日韩欧美国产不卡 | 国产综合网址 | 一区二区三区视频在线 | 爱爱视频网 |