Description: 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) //延时
}
}
To Search:
File list (Check if you may need any files):
角度传感器测角度
................\1
................\1.hex
................\1.lnp
................\1.M51
................\1.plg
................\1.uvopt
................\1.uvproj
................\1_uvopt.bak
................\1_uvproj.bak
................\adxl345.c
................\adxl345.h
................\adxl345.LST
................\adxl345.OBJ
................\delay.c
................\delay.h
................\delay.LST
................\delay.OBJ
................\lcd1602.c
................\lcd1602.h
................\lcd1602.LST
................\lcd1602.OBJ
................\main.c
................\main.LST
................\main.OBJ