当前位置:网站首页>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
边栏推荐
- On lambda powertools typescript
- Idea of batch manufacturing test data, with source code
- Customize my_ Strcpy and library strcpy [analog implementation of string related functions]
- PostgreSQL列存与行存
- Paging the list collection
- Multithreaded @ async thread pool
- CentOS MySQL multi instance deployment
- Clickhouse - data type
- Shell-sort命令的使用
- About stream flow, write it down briefly------
猜你喜欢
Nifi fast installation and file synchronization
Lock锁
Get the column name list of the table quickly in Oracle
Getting started with JDBC
TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
线性代数感悟之2
文件操作《二》(5000字总结篇)
Use between nodejs modules
How vscode compares the similarities and differences between two files
Signalr can actively send data from the server to the client
随机推荐
Bytevcharts visual chart library, I have everything you want
SQL: How to parse Microsoft Transact-SQL Statements in C# and to match the column aliases of a view
PHP高效读大文件处理数据
C语言函数详解
Quick install mongodb
Variable length parameter__ VA_ ARGS__ Macro definitions for and logging
Website_ Collection
First knowledge of go language
Introduction to new functions of camtasia2022 software
websocket
freeCodeCamp----shape_ Calculator exercise
Input file upload
文件操作《二》(5000字总结篇)
Milvus 2.0 質量保障系統詳解
Installing labellmg tutorial in Windows
1-3 nodejs installation list configuration and project environment
【生活中的逻辑谬误】稻草人谬误和无力反驳不算证明
Shell - introduction, variables, and basic syntax
1-2 JSX syntax rules
VLAN高级技术,VLAN聚合,超级Super VLAN ,Sub VLAN