- 1、本文档共19页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
BH1750数字光照(国外英文资料)
BH1750数字光照(国外英文资料)
* * * * * * * * *
# include reg5.h
Include math.h / / Keil library
Include stdio. H / / Keil library
# include INTRINS. H
# define uchar unsigned char
Pound sign define uint unsigned int
# define SlaveAddress 0x46 / / define the device in the IIC bus from the ADDRESS, which is modified according to the ALT ADDRESS ADDRESS
/ / ALT ADDRESS the ADDRESS is 0x46 when the base is ground, and the ADDRESS is 0xB8 when the power is plugged
Sbit SCL P1 = ^ 0; / / IIC clock is defined
Sbit SDA P1 = ^ 1; / / IIC data pins definition
Typedef unsigned char BYTE;
Typedef unsigned short WORD;
BYTE BUF, [8]; / / receive the data cache area
Uchar ge, shi, bai, qian, wan; / / display variable
Int dis_data; / / variable
Void delay_nms (unsigned int k);
Void Init_BH1750 (void);
Void conversion (uint temp_data);
Void Single_Write_BH1750 (uchar REG_Address); / / a single write data
Uchar Single_Read_BH1750 (uchar REG_Address); / / a single reading of internal register data
Void Multiple_Read_BH1750 (); / / continuously read internal register data
I dont know what Im going to do
Void Delay5us ();
Void Delay5ms ();
Void BH1750_Start (); / / initial signal
Void BH1750_Stop (); / / stop sign
Void BH1750_SendACK (bit ack); / / response ACK
Bit BH1750_RecvACK (); / / read an ack
Void BH1750_SendByte (BYTE dat); / / IIC single byte writes
BYTE BH1750_RecvByte (); / / IIC reads per byte
I dont want to know
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Void conversion (uint temp_data) / / data transformation, 10, 100, 1000, 000
{
Wan = temp_data / 10000 + 0x30;
Temp_data = temp_data % 10000; / / fetch
Qian = temp_data / 1000 + 0x30;
Temp_data = temp_data % 1000; / / fetch
Bai = temp_data / 100 + 0x30;
Temp_data = temp_data % 100; / / fetch
Shi = temp_data / 10 + 0x30;
Temp_data = temp_data % 10; / / fetch
Ge = temp_data + 0 x30;
}
It is the second time of the year
Void delay_nms (unsigned int k)
{
Un
您可能关注的文档
- 2015年普法读本练习题 一(国外英文资料).doc
- 2015年清华大学清华视觉传达考研经验分享(国外英文资料).doc
- 2015年清华大学风景园林硕士考研经验分享(国外英文资料).doc
- 2014香港标杆房企住宅、豪宅、别墅及商业地产考察(9月26-28日)(国外英文资料).doc
- 2015必威体育精装版贺州科目三考试技巧(国外英文资料).doc
- 2015水利安全知识6(国外英文资料).doc
- 2015监理房屋建筑工程延续注册考试题(国外英文资料).doc
- 2015高考一轮复习章末检测静电场试题及答案-19(国外英文资料).doc
- 2016年下半年《计算机维护与维修》期末考试试题及答案(国外英文资料).doc
- 2014年度环保考试题(国外英文资料).doc
- 2024年证券分析与咨询服务项目投资申请报告代可行性研究报告.docx
- 2024年铬酸酐项目资金申请报告代可行性研究报告.docx
- 2024年清洁胶项目资金申请报告代可行性研究报告.docx
- 2024年肉松饼项目投资申请报告代可行性研究报告.docx
- 2024年陆上泵项目资金需求报告代可行性研究报告.docx
- 2024年未硫化复合橡胶及其制品项目资金需求报告代可行性研究报告.docx
- 2024年精密温控节能设备项目资金筹措计划书代可行性研究报告.docx
- 2024年汽车覆盖件模具项目资金筹措计划书代可行性研究报告.docx
- 宋词行书钢笔字帖.pdf
- 我的暑假生活作文三年级300字10篇.pdf
文档评论(0)