当前位置:网站首页>Design of piece counter based on 51 single chip microcomputer
Design of piece counter based on 51 single chip microcomputer
2022-06-30 17:02:00 【toyjis】
This project is based on 51 Piece counter of single chip microcomputer , The content of the project is : Realize the function of piece counter , This has practical significance for counting goods in the factory ; The detection distance is automatically set after the system is powered on 20cm, Objects less than this distance will cause the count to change and the buzzer to sound , Each object can only be triggered once ; Two nixie tubes are used to display the detection distance and the number of articles ; Use two keys to adjust the detection distance .
The project uses 51 Four interrupt sources of single chip microcomputer , Respectively : External interrupt 0, Timer interrupt 0, External interrupt 1, Timer interrupt 1. Basically, the foundation has been used up 51 All interrupt sources of the kernel , There is interrupt nesting between two timer interrupts , Is a good example of learning MCU interrupt !!
Project adoption Proteus Do simulation experiments , The following figure is the schematic diagram of the project , The ultrasonic sensor adopts HC-SR04(SRF04).
use ad The schematic diagram is drawn PCB, Layout size 8*9cm, Larger space , Easy to weld .

Part of the code is as follows , The main content of the project is : Nested use of interrupts 、 Sensor driver code 、 Nixie tube display code .
void start()// Ranging initialization
{
TR=1;
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
TR=0;
}
int getdistance(void)
{
start();
while(!ECHO);
TR1=1;
while(ECHO);
TR1=0;
time=TH1*256+TL1;
TH1=0;
TL1=0;
s=(time*1.7)/100; // Measured cm
if(flag==1||(s>700))
{
flag=0;
s=0;
return s;
}
return s;
}
The complete project includes :keilC The language code +Proteus Simulation schematic +ad Schematic diagram PCB+ Product specification
边栏推荐
- register_ Chrdev and CDEV_ init cdev_ Add usage differences
- On July 2, I invited you to TD Hero online conference
- Additional: (not written yet, don't look at ~ ~ ~) webmvcconfigurer interface;
- BC1.2 PD协议
- In order to make remote work unaffected, I wrote an internal chat room | community essay
- Restartprocessifvisible process
- Bidding announcement: Taizhou Unicom Oracle all in one machine and database maintenance service project in 2022
- 互联网研发效能实践之去哪儿网(Qunar)核心领域DevOps落地实践
- 商单视频播放超2000万!农院改造为何屡被催更?
- 中航无人机科创板上市:市值385亿 拳头产品是翼龙无人机
猜你喜欢

Good partner for cloud skill improvement, senior brother cloud of Amazon officially opened today

【微信小程序】常用组件基本使用(view/scroll-view/swiper、text/rich-text、button/image)

Restartprocessifvisible process

Raft introduction

牛客网:有多少个不同的二叉搜索树

redis淘汰策略

居家办公浅谈远程协助快速提效心得 | 社区征文

Installing jupyter notebook under Anaconda

Bc1.2 PD protocol

异常类_日志框架
随机推荐
Etcd教程 — 第九章 Etcd之实现分布式锁
halcon知识:矩阵专题【02】
CMakeLists 基础
Rong Lianyun launched rphone based on Tongxin UOS to create a new ecology of localization contact center
【微信小程序】常用组件基本使用(view/scroll-view/swiper、text/rich-text、button/image)
geo 读取单细胞csv表达矩阵 单细胞 改列名 seurat
微信表情符号写入判决书,你发的OK、炸弹都可能成为“呈堂证供”
【机器学习】K-means聚类分析
9:第三章:电商工程分析:4:【通用模块】;(待写……)
赛芯电子冲刺科创板:拟募资6.2亿 实控人谭健为美国籍
巩固入门-C#基础变量和常量
Restartprocessifvisible process
JS ES5也可以创建常量?
[bjdctf2020]the mystery of ip|[ciscn2019 southeast China division]web11|ssti injection
Hologres shared cluster helps Taobao subscribe to the extreme refined operation
Etcd教程 — 第八章 Etcd之Compact、Watch和Lease API
[wechat applet] the hosting environment of the applet
IndexSearch
Mathematical modeling for war preparation 36 time series model 2
idea必用插件