资 源 简 介
#include "adxl345.h"
#include "main.h"
#include "myiic.h"
#include "math.h"
#include "main.h"
#include
#include "stm32f1xx_hal_uart.h"
#include "usart.h"
void ADXL345_write(u8 addr, u8 data)
{
IIC_Start();
IIC_Send_Byte(ADXL_WRITE);
IIC_Wait_Ack();
IIC_Send_Byte(addr);
IIC_Wait_Ack();
IIC_Send_Byte(data);
IIC_Wait_Ack();
IIC_Stop();
HAL_Delay(10);
}
u8 ADXL345_read(u8 addr)
{
u8 d = 0;
IIC_Start();
IIC_Send_Byte(ADXL_WRITE);
IIC_Wait_Ack();
IIC_Send_Byte(addr);
IIC_Wait_Ack();
II