#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 28
下载积分: 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 个回复

  • 图像拼接C++代码
    本程序利用C++语言,结合opencv库,实现了将一幅图像中某个指定区域拼接到另外一个图像指定的位置,算法实现简单可靠。
    2022-07-22 02:08:26下载
    积分:1
  • RutineDemo
    公交路线模拟(在开发有关地理定位的应用程序时,程序中经常需要描述各个地点的位置以及交通路线情况。为了清晰、准确地描述某个地点信息,通常采用图形和文字相结合的方式。本例实现了一个公交路线的模拟程序,利用CStatic控件存储各个站点信息)。(Bus route simulation (in the development of geo-positioning applications, the programs often need to describe the location of various locations and traffic route. In order to clear, accurate description of a location information, usually a combination of graphics and text the way. The Example realization of a bus route simulation program, using CStatic control information stored in various sites).)
    2008-02-28 18:57:10下载
    积分:1
  • 任务管理系统
    使用系统反射;
    2022-01-26 07:27:22下载
    积分:1
  • clock
    C++ code for Digital Clock Working
    2014-09-06 19:54:09下载
    积分:1
  • FireTest
    OpenGL实现三维火焰实时模拟;可切换视角;资源耗费少,系统要求底,实时性能好。(OpenGL implementation of real-time three-dimensional flame simulation can switch perspective resources to spend less, the system requirements at the end of better real-time performance.)
    2020-12-21 18:29:09下载
    积分:1
  • 222
    这是我学习vc++的资料。希望对大家有帮助。 谢谢(This is my vc++ to learn the information. We want to help. Thanks)
    2009-07-14 10:37:07下载
    积分:1
  • fudianshuchuli
    说明:  浮点数的定义及计算方法,可用于初级学习之用(floap contral)
    2010-04-09 12:32:03下载
    积分:1
  • Rundeopt
    this is file .m that can be run at matlab
    2009-07-13 02:12:08下载
    积分:1
  • JM-01导盲设备驱动
    JM-01导航设备驱动源码,2018年互联网+大赛作品,以供学习参考。(JM-01 navigation device driver source code, 2018 Internet + Competition works, for learning reference.)
    2020-06-22 19:20:01下载
    积分:1
  • 0-1bag
    经典的0-1背包问题,程序可以自动输入并且有注释(Classical 0-1 knapsack problem, the program can automatically entered and annotated)
    2014-01-31 08:54:38下载
    积分:1
  • 696524资源总数
  • 103920会员总数
  • 65今日下载