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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

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

stm32f103c6使用三片74HC595級聯(lián)程序代碼Proteus仿真原理圖

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:928738 發(fā)表于 2022-1-24 15:29 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)


單片機(jī)源程序如下:
  1. //實(shí)驗現(xiàn)象:3位數(shù)碼管輪流顯示數(shù)碼管編碼表里面的字符
  2. #include "led.h"
  3. #include "delay.h"
  4. #include "sys.h"
  5. #include "HC595.h"

  6. unsigned char Qian_Wei,Bai_Wei,Shi_Wei,Ge_Wei;        //千位,百位,十位,個位

  7. //數(shù)碼管編碼
  8. unsigned char table[] =
  9. {0xc0,0xf9,0xa4,0xb0,0x99,
  10. 0x92,0x82,0xf8,0x80,0x90,
  11. 0xff,0x00,0x90,0x86,0xaf,
  12. 0xc0,0x89,0xc7,0x8e,0xc1,0x7f};
  13. //0,1,2,3,4,5,6,7,8,9,全暗,全亮,g,E,r,O,H,L,F,U,小數(shù)點(diǎn),共陽數(shù)碼管使用


  14. int main(void)
  15. {
  16.         int a, b, c, d;
  17.         a = 0;//這些常量置0,否則后面顯示會出問題
  18.         b = 0;
  19.         c = 0;
  20.         d = 0;
  21.         SystemInit();                                        //系統(tǒng)時鐘初始化為72M          SYSCLK_FREQ_72MHz
  22.         delay_init(72);                                //延時函數(shù)初始化
  23.         NVIC_Configuration();        //設(shè)置NVIC中斷分組2:2位搶占優(yōu)先級,2位響應(yīng)優(yōu)先級
  24.         LED_Init();                                                //LED端口初始化
  25.         HC595_Init();
  26.        
  27.         //清空LED數(shù)碼管
  28.         Bai_Wei = table[10];//清空LED
  29.         Shi_Wei = table[10];//清空LED
  30.         Ge_Wei = table[10];//清空LED
  31.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  32.         delay_ms(3000);
  33.        
  34.         //依次測試百位至個位全亮
  35.         Bai_Wei = table[11];//百位全亮
  36.         Shi_Wei = table[10];//清空LED
  37.         Ge_Wei = table[10];//清空LED
  38.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  39.         delay_ms(2000);
  40.         Bai_Wei = table[10];//清空LED
  41.         Shi_Wei = table[11];//十位全亮
  42.         Ge_Wei = table[10];//清空LED
  43.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  44.         delay_ms(2000);
  45.         Bai_Wei = table[10];//清空LED
  46.         Shi_Wei = table[10];//清空LED
  47.         Ge_Wei = table[11];//個位全亮
  48.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  49.         delay_ms(2000);
  50.        
  51.         //同時顯示0~9
  52.         Bai_Wei = table[0];
  53.         Shi_Wei = table[0];
  54.         Ge_Wei = table[0];
  55.         HC595_Display(Bai_Wei, Shi_Wei, Ge_Wei);
  56.         delay_ms(2000);
  57.         Bai_Wei = table[1];
  58.         Shi_Wei = table[1];
  59.         Ge_Wei = table[1];
  60.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  61.         delay_ms(2000);
  62.         Bai_Wei = table[2];
  63.         Shi_Wei = table[2];
  64.         Ge_Wei = table[2];
  65.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  66.         delay_ms(2000);
  67.         Bai_Wei = table[3];
  68.         Shi_Wei = table[3];
  69.         Ge_Wei = table[3];
  70.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  71.         delay_ms(2000);
  72.         Bai_Wei = table[4];
  73.         Shi_Wei = table[4];
  74.         Ge_Wei = table[4];
  75.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  76.         delay_ms(2000);
  77.         Bai_Wei = table[5];
  78.         Shi_Wei = table[5];
  79.         Ge_Wei = table[5];
  80.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  81.         delay_ms(2000);
  82.         Bai_Wei = table[6];
  83.         Shi_Wei = table[6];
  84.         Ge_Wei = table[6];
  85.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  86.         delay_ms(2000);
  87.         Bai_Wei = table[7];
  88.         Shi_Wei = table[7];
  89.         Ge_Wei = table[7];
  90.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  91.         delay_ms(2000);
  92.         Bai_Wei = table[8];
  93.         Shi_Wei = table[8];
  94.         Ge_Wei = table[8];
  95.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  96.         delay_ms(2000);
  97.         Bai_Wei = table[9];
  98.         Shi_Wei = table[9];
  99.         Ge_Wei = table[9];
  100.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  101.         delay_ms(2000);
  102.         HC595_Display(Bai_Wei, Shi_Wei,Ge_Wei);
  103.         delay_ms(2000);
  104.        
  105.         while(1)
  106.         {               
  107.                 LED0=0;                                                        //這里使用了位帶操作,也可以使用 GPIO_ResetBits(GPIOA,GPIO_Pin_8);
  108.                 delay_ms(20);                 
  109.                 LED0=1;                                                        //也可以使用          GPIO_SetBits(GPIOA,GPIO_Pin_8);                           
  110.                 delay_ms(20);                       

  111.                 a++;
  112.                 if(a==1)
  113.                 {
  114.                         a = 0;
  115.                         b++;
  116.                 }
  117.                 if(b == 10)
  118.                 {
  119.                         b = 0;
  120.                          c++;
  121.                 }
  122.                 if(c == 10)
  123.                 {
  124.                         c = 0;
  125.                         d++;                       
  126.                 }
  127.                 if(d == 10)d= 0;
  128.                 Bai_Wei = table[d];
  129.                 Shi_Wei = table[c];
  130.                 Ge_Wei = table[b];
  131.                 HC595_Display(Bai_Wei,Shi_Wei,Ge_Wei);
  132.                 //delay_ms(100);
  133.         }
  134. }
復(fù)制代碼

所有資料51hei附件下載:
代碼: STM32F103C6.7z (179.12 KB, 下載次數(shù): 89)
仿真: protues.zip (65.16 KB, 下載次數(shù): 71)


評分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

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

使用道具 舉報

沙發(fā)
ID:619071 發(fā)表于 2022-2-6 21:58 | 只看該作者
想問一下,我的是proteus8.9 里面搜不到STM32的MCU,應(yīng)該怎么操作啊
回復(fù)

使用道具 舉報

板凳
ID:928738 發(fā)表于 2022-2-10 11:20 | 只看該作者
lishuo123 發(fā)表于 2022-2-6 21:58
想問一下,我的是proteus8.9 里面搜不到STM32的MCU,應(yīng)該怎么操作啊

我protues8.0就可以,你是不是庫沒裝好?安裝要聯(lián)網(wǎng)
回復(fù)

使用道具 舉報

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

本版積分規(guī)則

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

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

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 在线视频亚洲 | 精品久久久久久亚洲精品 | 亚洲第一天堂无码专区 | 99久久精品一区二区毛片吞精 | 欧美乱做爰xxxⅹ久久久 | 久久影院一区 | 精品国产一区二区国模嫣然 | 亚洲欧美综合精品久久成人 | 免费久久久久久 | 国产日韩欧美中文字幕 | 91精品在线观看入口 | 日韩成人一区 | 久久久久国 | 日韩一区在线播放 | 91av在线不卡 | 亚洲一区二区在线电影 | 午夜小电影 | 日韩网站免费观看 | 一级黄色短片 | 久草a√| 色婷婷亚洲国产女人的天堂 | 91精品国产欧美一区二区成人 | 日本精品一区二区 | 久久香蕉网 | 欧美综合国产精品久久丁香 | 98成人网 | 91精品国产综合久久久久久丝袜 | 色吧综合 | 国产成人高清 | 国产精品久久国产精品 | 久久在线 | 在线激情视频 | 国产亚洲一区二区精品 | 午夜久久久久久久久久一区二区 | 羞羞网站在线免费观看 | 久草热视频 | 国产成人在线一区二区 | 嫩草伊人 | 欧美日韩在线精品 | 精品久久久久香蕉网 | 中文字幕免费在线观看 |