91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 37KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-05-18
  • 語(yǔ)言: 其他
  • 標(biāo)簽: 51單片機(jī)??

資源簡(jiǎn)介

用51單片機(jī)模擬空調(diào)遙控器,遙控編碼可改。

資源截圖

代碼片段和文件信息

#include??
#include?

typedef????unsigned?char???uchar;
typedef????unsigned?int????uint;
typedef????unsigned?long????ulong;
//#define?_Nop()?_nop_()
#define?scan_key_port?P1
sbit?PWM_out?=?P2^3;???????????//PWM輸出
sbit?lcd_rs_port?=?P2^4;???/*定義LCD控制端口*/
sbit?lcd_rw_port?=?P2^5;???/*定義LCD控制端口*/
sbit?lcd_en_port?=?P2^6;???/*定義LCD控制端口*/
#define?lcd_data_port?P0???/*定義LCD控制端口*/
bit?timer_flag=0; ???????//定時(shí)器0定時(shí)100us標(biāo)志位
unsigned?int?timer_cnt;???????????//定時(shí)器0定時(shí)100us的次數(shù)的計(jì)數(shù)值
unsigned?int?t_temp; ??? ???//控制器載波的時(shí)間值,100us為單位
/******************************************全局變量************************/??
//數(shù)據(jù)1高電平時(shí)間,低電平時(shí)間,數(shù)據(jù)0高電平時(shí)間,低電平時(shí)間
char?dat_one_h_t??dat_one_l_t??dat_zero_h_t??dat_zero_l_t;
//頭高電平時(shí)間,頭低電平時(shí)間
char?head_one_t??head_zero_t;
//地址長(zhǎng)度,數(shù)據(jù)長(zhǎng)度
char?head_Num??adr_Numdat_Num;

char?addr_code[5]data_code[4];
uchar?addr_code1[5]={0x000x000x040x0a0x5f}; ?//20ms前基本代碼
uchar?data_code1[4]={0x000x040x000x00}; ?//20ms后基本代碼

struct?head_type
{??
????????char?H_H;????????????//頭高電平時(shí)間
????????char?H_L;????????????//頭低電平時(shí)間
????????char?D0_H;???????????//數(shù)據(jù)0高電平時(shí)間
????????char?D0_L;???????????//數(shù)據(jù)0低電平時(shí)間
????????char?D1_H;???????????//數(shù)據(jù)1高電平時(shí)間
char?D1_L;???????????//數(shù)據(jù)1低電平時(shí)間
char?adr_N;
char?dat_N;
};
code?struct?head_type?head={9045535123632};


bit?ON_flag=0;
char?MODE_flag=0;
char?FENG_flag=0;
bit?VS_flag=0;
bit?HS_flag=0;
uint?T_dat=16;
bit?open_flag=0;
////////////////////////////////////////////////
////////////////////////////////////////////////
unsigned?char?mun_char_table[]={“0123456789abcdef“};
uchar?code?line0[16]={“ON:???M:???F:???“};
uchar?code?line1[16]={“VS:??HS:??T:????“};

//100us間隔定時(shí)器

void?delay(unsigned?int?ms);

//////////////以下是LCD1602驅(qū)動(dòng)程序////////////////

void?lcd_delay(uchar?ms)?/*LCD1602?延時(shí)*/
{
????uchar?j;
????while(ms--){
????????for(j=0;j<250;j++)
????????????{;}
????????}???
}


void?lcd_busy_wait()?/*LCD1602?忙等待*/
{
????lcd_rs_port?=?0;
????lcd_rw_port?=?1;
????lcd_en_port?=?1;
????lcd_data_port?=?0xff;
????while?(lcd_data_port&0x80);
????lcd_en_port?=?0;?

}


void?lcd_command_write(uchar?command)?/*LCD1602?命令字寫入*/
{
????lcd_busy_wait();
????lcd_rs_port?=?0;
????lcd_rw_port?=?0;
????lcd_en_port?=?0;
????lcd_data_port?=?command;
????lcd_en_port?=?1;
????lcd_en_port?=?0;?????
}



void?lcd_system_reset()?/*LCD1602?初始化*/
{
????lcd_delay(20);
????lcd_command_write(0x38);//功能設(shè)置:八位數(shù)據(jù)總線,兩行顯示
????lcd_delay(100);
????lcd_command_write(0x38);
????lcd_delay(50);
????lcd_command_write(0x38);
????lcd_delay(10);
????lcd_command_write(0x08);//關(guān)顯示
????lcd_command_write(0x01);//清屏
????lcd_command_write(0x06);//顯示指針自加
????lcd_command_write(0x0c);//開顯示
}



void?lcd_char_write(uchar?x_posy_poslcd_dat)?/*LCD1602?字符寫入*/
{
????x_pos?&=?0x0f;?/*?X位置范圍?0~15?*/
????y_pos?&=?0x01;?/*?Y位置范圍?0~?1?*/
????if(y_pos==1)?x_pos?+=?0x40;
????x_pos?+=?0x80; //LCD第一行首地址
????lcd_command_write(x_pos);
????l

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-08-11?15:00??基于51單片機(jī)的空調(diào)遙控器C源程序\
?????文件???????11354??2011-01-05?22:56??基于51單片機(jī)的空調(diào)遙控器C源程序\main.c
?????文件???????23737??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\main.LST
?????文件???????24463??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\main.OBJ
?????文件???????20118??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控
?????文件????????5253??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控.hex
?????文件??????????44??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控.lnp
?????文件???????27198??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控.M51
?????文件????????1495??2015-08-11?15:00??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控.Opt
?????文件?????????196??2015-08-11?14:58??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控.plg
?????文件????????2139??2015-08-10?10:19??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控.Uv2
?????文件????????1495??2015-08-10?10:19??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控_Opt.Bak
?????文件????????1991??2013-08-17?10:33??基于51單片機(jī)的空調(diào)遙控器C源程序\紅外遙控_Uv2.Bak

評(píng)論

共有 條評(píng)論

相關(guān)資源