红外感光智能LED台灯设计Word下载.docx
- 文档编号:13800849
- 上传时间:2022-10-13
- 格式:DOCX
- 页数:29
- 大小:267.46KB
红外感光智能LED台灯设计Word下载.docx
《红外感光智能LED台灯设计Word下载.docx》由会员分享,可在线阅读,更多相关《红外感光智能LED台灯设计Word下载.docx(29页珍藏版)》请在冰豆网上搜索。
自动调光模块;
HS0038;
红外遥控器
ABSTRACT
Withthesocialprogressandthe
improvementoflivingstandards,
pursuing
ordertomeetthe
demandsof
people
ofaninfraredphotosensitive
inligentLEDlampinthisdesign.Theproductcanovercomethequestionofthecommondesklampcannotautomaticallyadjustthebrightnessaccordingtotheenvironmentallightintensity,whichallowstheuserstogetmorecomfortableexperienceandcanprotecttheinacertainextentandmoreenergy-efficient.
ThecontentofthisdesignisbasedonthecontrolofMCU.Itmakesthelamp
withthefunctionof
bodyinduction,automaticallyadjustthelampbrightnessaccordingtotheambientlightintensity,.Andinordertomeetsomespecialrequirementsoftheusers,thelampisalsoprovidedwithamanualadjustmentfunction.Thecontroloflampincludesthekeycontrolandtheinfraredremotecontrol.whichmakesthelampcontrolmoreconvenientandflexible.
Thedesignincludesbodyinductionmodule,HS0038infraredremotecontrolreceivingmodule,infraredremotecontroller,theLEDluminouscircuitcomposed.ThesoftwareusesflexibleClanguageprogrammingtogettheeffectivecontrolofthe()
{
uint8jj=0;
while
(1)
sweep();
if((mode==0)&
&
(ii==0))
{
if(;
uint8byte=0;
SDA=1;
for(n=0;
n<
8;
n++)
SCL=0;
_nop_();
SCL=1;
byte<
<
=1;
if(SDA==1)
byte=byte+1;
}
_nop_();
return(byte);
voidAck_I2c(uint8a)*判断是否非应答信号*
{
if(a==0)
SDA=0;
elseSDA=1;
SCL=1;
voidwriteIIC(uint8x,uint8y)*写两个IIC字节*
iicstart();
iicsendbyte(x);
if(ack==0)
return;
iicsendbyte(y);
iicstop();
uint8readIIC(uint8z)*读取模数转化信号*
uint8bb;
iicsendbyte(z+1);
return(0);
bb=iicreadbyte();
Ack_I2c
(1);
return(bb);
voiddelay()*延时函数*
uint16dd;
uint8ee;
for(ee=0;
ee<
40;
ee++)
for(dd=0;
dd<
500;
dd++)
writeIIC(0x90,0x41);
aa=readIIC(0x90);
select();
}
}
voidsweep()*遥控+按键扫描*
uint8jj=0,i1,i2,cs=0;
while((cs++)<
18)
switch(jj)
case0:
if(key0==0)
delay1(1000);
if(key0==0)
ii=1-ii;
while(!
key0);
if(ii==1)
{
P0=0Xff;
P2=0Xff;
zhishi=1;
zhishi1=1;
}
if(ii==0)
zhishi=0;
jj++;
case1:
if(ii==0)
{
if(key1==0)
if(key1==0)
mode=1-mode;
if(mode==0)
key1);
}
case2:
if((ii==0)&
(mode==1))
{
zhishi1=0;
if(key2==0)
delay1(2000);
if(key2==0)
dc++;
if(dc%4==1)
P0=0Xf0;
P2=0Xff;
}
if(dc%4==2)
{
P0=0X00;
}
if(dc%4==3)
P2=0x0f;
if(dc%4==0)
P0=0Xff;
dc=0;
}
key2);
case3:
temp1=low();
if((temp1>
4608)&
(temp1<
9216))
{
temp2=(TH1*256+TL1);
uint16(TH1*256+TL1);
voidselect()*LED亮度控制函数*
if((aa>
=0xf0)&
(aa<
=0xff))
P0=0;
P2=0x0f;
=0xe0)&
=0xef))
P2=0x1f;
=0xd0)&
=0xdf))
P2=0x3f;
=0xc0)&
=0xcf))
P2=0x7f;
=0xb0)&
=0xbf))
P2=0xff;
=0xa0)&
=0xaf))
P0=0x01;
=0x90)&
=0x9f))
P0=0x03;
=0x80)&
=0x8f))
P0=0x07;
=0x70)&
=0x7f))
P0=0x0f;
=0x60)&
=0x6f))
P0=0x1f;
=0x50)&
=0x5f))
P0=0x3f;
=0x40)&
=0x4f))
P0=0x7f;
=0x00)&
=0x3f))
P0=0xff;
参考文献
1:
秦曾煌主编.《电工学》(第七版);
高等教育出版社,2009.09
2:
沙占友孟志永王彦朋《单片机外围电路设计》(第2版);
电子工业出版社,2006.
3:
刘娟梁卫文程莉等《单片机C语言与PROTUES仿真技能实训》;
中国电力出版社2010.08
4
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 红外 感光 智能 LED 台灯 设计