网站大量收购独家精品文档,联系QQ:2885784924

ADXL345直接输出角度值C51程序(国外英文资料).doc

ADXL345直接输出角度值C51程序(国外英文资料).doc

  1. 1、本文档共28页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ADXL345直接输出角度值C51程序(国外英文资料)

ADXL345直接输出角度值C51程序(国外英文资料) , * * * * * * * * * * / / GY - 29 ADXL345 IIC test program / / use STC89C51 / / vibrate: 11.0592 M / / display: LCD1602 / / compile environment Keil uVision2 / / reference macros 24c04 communication program / / time: March 1, 2011 / / QQ: 531389319 * * * * * * * * * # 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 DataPort P0 / / LCD1602 data port Sbit SCL P1 = ^ 0; / / IIC clock is defined Sbit SDA P1 = ^ 1; / / IIC data pins definition Sbit LCM_RS = P2 ^ 0; / / LCD1602 command port Sbit LCM_RW = P2 ^ 1; / / LCD1602 command port Sbit LCM_EN = P2 ^ 2; / / LCD1602 command port The # define SlaveAddress 0xA6 / / defines the ADDRESS in the IIC bus, which is modified by ALT ADDRESS ADDRESS / / ALT ADDRESS the ADDRESS is 0xA6 when the ground is ground, and the ADDRESS is 0x3A when the power is plugged in 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 Int data_xyz [3]; Void delay (unsigned int k); Void InitLcd (); / / initializes the lcd1602 Void Init_ADXL345 (void); / / initialize ADXL345 Void WriteDataLCM (uchar dataW); Void WriteCommandLCM (uchar CMD, uchar Attribc); Void DisplayOneChar (uchar X, uchar Y, uchar DData); Void conversion (uint temp_data); Void Single_Write_ADXL345 (uchar REG_Address, uchar REG_data); / / a single write data Uchar Single_Read_ADXL345 (uchar REG_Address); / / a single reading of internal register data Void Multiple_Read_ADXL345 (); / / continuously read internal register data I dont know what Im going to do Void Delay5us (); Void Delay5ms (); Void ADXL345_Start (); Void ADXL345_Stop (); Void ADXL345_SendACK (bit ack); Bit ADXL345_RecvACK () Void ADXL345_SendByte (BYTE dat); BYTE ADXL345_RecvByte (); Void ADXL345_ReadPage (); Void ADXL345_WritePag

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档