当前位置:网站首页>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
边栏推荐
- Rongsheng biology rushes to the scientific innovation board: it plans to raise 1.25 billion yuan, with an annual revenue of 260million yuan
- 异常类_日志框架
- 中航无人机科创板上市:市值385亿 拳头产品是翼龙无人机
- Carry two load balancing notes and find them in the future
- In order to make remote work unaffected, I wrote an internal chat room | community essay
- 2022蓝桥杯国赛B组-费用报销-(线性dp|状态dp)
- 牛客网:有多少个不同的二叉搜索树
- Raft介绍
- differential analysis between different groups nichenet for silicosis成功运行!
- Hologres共享集群助力淘宝订阅极致精细化运营
猜你喜欢

Mathematical modeling for war preparation 33- grey prediction model 2

Tutoriel etcd - chapitre 8 API compacte, Watch et lease pour etcd

List announced - outstanding intellectual property service team in China in 2021

Half year inventory of new consumption in 2022: the industry is cold, but these nine tracks still attract gold

9:第三章:电商工程分析:4:【通用模块】;(待写……)
![[machine learning] K-means clustering analysis](/img/5f/3199fbd4ff2129d3e4ea518812c9e9.png)
[machine learning] K-means clustering analysis

名单揭晓 | 2021年度中国杰出知识产权服务团队

Raft介绍

香港回归25周年 香港故宫博物馆正式开放成文化新地标

How to connect the Internet Reading Notes - Summary
随机推荐
2020 Blue Bridge Cup group B - move bricks - (greedy sorting +01 backpack)
CMakeLists 基础
Php7.3 centos7.9 installing sqlserver extensions
备战数学建模35-时间序列预测模型
Niuke: how many different binary search trees are there
香港回归25周年 香港故宫博物馆正式开放成文化新地标
Headhunter 50, 000, I'll go to VC
Substrate 跨链技术源码级探索: XCVM的概览
Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column
Hologres shared cluster helps Taobao subscribe to the extreme refined operation
7 月 2 日邀你来TD Hero 线上发布会
On July 2, I invited you to TD Hero online conference
Go micro tutorial - Chapter 1 getting started
halcon知识:矩阵专题【02】
2022 Blue Bridge Cup group B - expense reimbursement - (linear dp| status DP)
“推广+搞笑剧情”,如何碰撞出爆款的火花?
More dragon lizard self-developed features! Production available Anolis OS 8.6 officially released
删除有序数组中的重复项 II[双指针--多情况统一]
OpenCV中LineTypes各枚举值(LINE_4 、LINE_8 、LINE_AA )的含义
Additional: (not written yet, don't look at ~ ~ ~) webmvcconfigurer interface;