Introduction - If you have any usage issues, please Google them yourself
Turn Angle sensor the basic control method. Part of the HTML code is as follows:
#include"lcd1602.h"
#include"delay.h"
#include"adxl345.h"
void main()
{
uchar devid
delay(500) //上电延时
init() //初始化
DisplayOneChar(0,0, A )
DisplayOneChar(1,0, : )
Init_ADXL345() //初始化ADXL345
devid=Single_Read_ADXL345(0X00) //读出的数据为0XE5,表示正确
while(1) //循环
{
Multiple_read_ADXL345() //连续读出数据,存储在BUF中
display_x() //---------显示X轴
display_y() //---------显示Y轴
display_z() //---------显示Z轴
show_o()
delay(200) //延时
}
}