#include"stm32f1xx_hal_uart.h" #include"usart.h" voidADXL345_write(u8addr-ADXL345模块-c - IMDN开发者社群-imdn.cn" /> #include"stm32f1xx_hal_uart.h"#include"usart.h"voidADXL345_write(u8addr,u8data){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);}u8ADXL345_read(u8addr){  u8d=0;  IIC_Start();  IIC_Send_Byte(ADXL_WRITE);  IIC_Wait_Ack();  IIC_Send_Byte(addr);  IIC_Wait_Ack();  II-IMDN开发者社群-imdn.cn"> #include"stm32f1xx_hal_uart.h"#include"usart.h"voidADXL345_write(u8addr,u8data){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);}u8ADXL345_read(u8addr){  u8d=0;  IIC_Start();  IIC_Send_Byte(ADXL_WRITE);  IIC_Wait_Ack();  IIC_Send_Byte(addr);  IIC_Wait_Ack();  II - IMDN开发者社群-imdn.cn">
登录
首页 » c » ADXL345模块

ADXL345模块

于 2022-05-28 发布 文件大小:2.21 kB
0 134
下载积分: 2 下载次数: 1

代码说明:

#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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 空气质量监测系统Arduino代码
    用Arduino做的空气质量监测装置,监测PM2.5的传感器数据,计算脉冲宽度,根据表格计算PM2.5 PM10的浓度,同时监测空气中 CO2 SO2 等数据通过GPRS上传至服务器
    2023-06-01 07:15:02下载
    积分:1
  • 实现画矩形、椭圆和随手画功能
    由VC实现画矩形、椭圆和随手画功能,对图像处理人员会有帮助(paintings by VC rectangular, oval and hand painting functions, image processing staff to be helpful)
    2005-06-28 00:40:48下载
    积分:1
  • tupc
    非线性方程组的解法,牛顿方法,参考数值算法集()
    2018-07-05 05:21:53下载
    积分:1
  • LED
    at89c51 的跑马灯程序. 把LED灯连接到端口0然后用烧录到单片机就行了.(This is an AT89C51 LED chaser program. Connect LEDs to port 1 and then use KEIL to compile the leds1.C into a .hex file then download t to your microcontroller.)
    2009-11-21 20:49:09下载
    积分:1
  • mpgwrite_6.0_update
    dec code mpeg par matlab
    2011-01-03 08:22:50下载
    积分:1
  • Brushless-Motor-Driver
    无刷电机驱动程序 霍尔传感器 PID算法调节(Brushless Motor Driver Hall sensor PID algorithm)
    2015-02-13 13:45:44下载
    积分:1
  • Attitude-Indicator
    This Program simulates "Attitude Indicator" of any aircraft. communication with serial port is not important for compiling and executing source code with Turbo C++. This program is good ideas for using mouse and 2D graphic, and has other learning subjects.
    2012-11-23 07:02:19下载
    积分:1
  • IPM
    该算法实现了将一幅图像进行透视变换,并生成鸟瞰图。(The algorithm to achieve the perspective transformation to an image, and generate a bird s-eye view.)
    2017-03-07 11:26:59下载
    积分:1
  • 002
    读写器管理(RM)标准,读写器管理标准的相关说明。(Reader Management (RM) standards, reader management standards for instructions.)
    2010-01-09 20:28:39下载
    积分:1
  • STM32小车循迹避障(原)
    说明:  STM32f103智能小车循迹避障c语言程序。。。。(STM32 WISE CAR xunji bizhang c langguage)
    2020-02-19 18:54:23下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载