当前位置:网站首页>Simulation of infrared wireless communication based on 51 single chip microcomputer
Simulation of infrared wireless communication based on 51 single chip microcomputer
2022-04-23 17:09:00 【Xiao ~ Xiaoyan】
Catalog
Download address : be based on 51 MCU infrared wireless communication simulation
One 、 Project functions
The project is divided into master and slave , The host collects the temperature and light intensity IRLINK The infrared wireless transmitter transmits it to the slave , And in 12864 On the LCD screen .
Two 、 Simulation
temperature 83、 No brightness
temperature 65、 Have brightness
3、 ... and 、 Program
Partial procedure
#include <REG51.h>
#include <intrins.h>
#include "hongwaifashe.h"
void hongwaifashe(void)
{
TMOD = 0x01; //T0 16 Bit working mode
IR=1; // The transmitting port is normally at high level
ZZ(setdata[0]);
ZZ(setdata[1]);
}
void ZZ(uchar x)
{
TT0(1,m9); // High level 9mS
TT0(0,m4_5); // Low level 4.5mS
/*┈ send out 4 The frame data ┈*/
Z0(SBM);
Z0(~SBM);
Z0(x);
Z0(~x);
/*┈┈ End code ┈┈*/
TT0(1,m_56);
TT0(0,m40);
}/*┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
The functionality : Single frame sending program
Entrance parameters :1 The frame data
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈*/
void Z0(uchar temp)
{
uchar v;
for (v=0;v<8;v++) // loop 8 Secondary shift
{
TT0(1,m_56); // High level 0.65mS
if(temp&0x01) TT0(0,m1_68); // Send the lowest bit
else TT0(0,m_56);
temp >>= 1; // Moves to the right one
}
}
/*┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
The functionality :38KHz Pulse emission + Delay program
Entrance parameters :( Whether to transmit pulse , Delay time x (uS))
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈*/
void TT0(bit BT,uint x)
{
TH0 = x>>8; // Input T0 Initial value
TL0 = x;
TF0=0; // clear 0
TR0=1; // Start timer 0
if(BT == 0) while(!TF0); //BT=0 When not fired 38KHz The pulse only delays ;BT=1 launch 38KHz Pulse and delay ;
else while(1) //38KHz pulse , Duty cycle 5:26
{
IR = 0;
if(TF0)break;
if(TF0)break;
IR = 1;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
if(TF0)break;
}
TR0=0; // off timer 0
TF0=0; // Clear if the flag bit overflows 0
IR =1; // After the pulse stops , The transmitting port is normally at high level
}
版权声明
本文为[Xiao ~ Xiaoyan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231707173345.html
边栏推荐
- ASP. Net core configuration options (Part 1)
- 线性代数感悟之2
- Log4j output log information to file
- The new MySQL table has a self increasing ID of 20 bits. The reason is
- [pimf] openharmony paper Club - what is the experience of wandering in ACM survey
- Detailed explanation of the penetration of network security in the shooting range
- Derivation of Σ GL perspective projection matrix
- Document operation II (5000 word summary)
- Milvus 2.0 質量保障系統詳解
- Solution architect's small bag - 5 types of architecture diagrams
猜你喜欢
Node access to Alipay open platform sandbox to achieve payment function
Milvus 2.0 détails du système d'assurance de la qualité
Get the column name list of the table quickly in Oracle
feign报400处理
C语言函数详解
VLAN高级技术,VLAN聚合,超级Super VLAN ,Sub VLAN
Lock锁
线性代数感悟之2
Rtklib 2.4.3 source code Notes
Deep understanding of control inversion and dependency injection
随机推荐
Error in v-on handler: "typeerror: cannot read property 'resetfields' of undefined"
PHP efficiently reads large files and processes data
Change the password after installing MySQL in Linux
Shell-awk命令的使用
ASP. Net core reads the configuration file in the class library project
Shell-cut命令的使用
Node access to Alipay open platform sandbox to achieve payment function
Linux MySQL data timing dump
1-3 components and modules
Some problems encountered in recent programming 2021 / 9 / 8
Aiot industrial technology panoramic structure - Digital Architecture Design (8)
Milvus 2.0 质量保障系统详解
Use of Shell sort command
ACL 2022 | dialogved: a pre trained implicit variable encoding decoding model for dialogue reply generation
Decimal format decimal / datetime conversion processing
. net cross platform principle (Part I)
1-3 nodejs installation list configuration and project environment
Lock lock
Milvus 2.0 détails du système d'assurance de la qualité
Shell-sort命令的使用