|
演示視頻鏈接: https://pan.baidu.com/s/1qOGdBpRWb5VMYJKgBPyCLw
如果文件已經(jīng)失效請(qǐng)聯(lián)系論壇管理員更新鏈接,51黑論壇的每一個(gè)用戶(hù)分享的網(wǎng)盤(pán)內(nèi)容都是有備份的.
密碼: ttx9
myphoto.jpg (2.92 MB, 下載次數(shù): 59)
下載附件
2018-5-30 15:40 上傳
就是用光敏電阻焊接了一個(gè)感應(yīng)器,外面光線(xiàn)強(qiáng)時(shí)燈關(guān)閉,外面光線(xiàn)弱時(shí)燈打開(kāi)。有遮擋時(shí),數(shù)碼管自動(dòng)+1,從而實(shí)現(xiàn)了對(duì)物體的計(jì)數(shù)功能。
單片機(jī)源碼:
- #include "reg52.h"
- #define u8 unsigned char
- #define u16 unsigned int
- sbit sw1=P3^4;
- sbit sw2=P3^5;
- sbit sw3=P3^6;
- sbit e0=P2^0;
- sbit e1=P2^1;
- sbit e2=P2^2;
- sbit e3=P2^3;
- u8 ds[4]={0,0,0,0};
- u16 num=0;
- u8 code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
- u8 ajsm()
- {
- static u16 ms;
- if(sw3==0)
- {
- if(++ms==2)
- {
- return 1;
- }
- }
- else
- {
- ms=0;
- }
- return 0;
- }
復(fù)制代碼
全部資料51hei下載地址:
計(jì)算器.zip
(580 Bytes, 下載次數(shù): 22)
2018-5-30 15:40 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
評(píng)分
-
查看全部評(píng)分
|