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

  • 交通灯程序
    1.东西方向、南北方向均有红、黄、绿三种信号灯; 2.东西干道和南北干道,绿灯下情况通行,红灯情况下不行,黄灯情况下 慢行; 3.东西干道和南北干道交替控制; 4.实时提醒绿灯亮的剩余时间; 5.通行时间可调; 6.雾霾或夜间模式按钮按下,所有方向显示黄灯.(1. there are three red, yellow and green lights in east-west direction and north-south direction. 2. the East West trunk road and the north-south trunk road pass under the green light. 3. East and west main road and the north and South Main Road alternately control; 4. reminding the remaining time of the green light in real time; 5. the time can be adjusted; 6. haze or night mode button is pressed, all directions show yellow light.)
    2021-01-13 22:48:47下载
    积分:1
  • anycad.net.sdk.pro.2015.ur1.chs
    说明:  轻量级的三维画图控件,便于C/C++或C#等平台/语言中引用和开发(Lightweight 3D drawing control, convenient for reference and development in platforms / languages such as C/C++ or C#)
    2020-01-06 19:27:00下载
    积分:1
  • SPCE061A
    SPCE061A单片机程序开发的资料,非常好!(SPCE061A MCU application development, very good!)
    2012-09-17 23:29:03下载
    积分:1
  • Wi-Fi
    Wifi共享小软件,适用于win7以上系统,在接通网络后,还需要手动桥接一下网卡,做的不好,请大家斧正。(Wifi Tool,the min System is win7,after build,if u want run this tool,u must bridge network card)
    2015-11-20 09:51:14下载
    积分:1
  • 使用Visual C# 2005 中TreeView控件制作的类似WINDOWS资源管理器的目录结构...
    使用Visual C# 2005 中TreeView控件制作的类似WINDOWS资源管理器的目录结构-The use of Visual C# 2005 in the TreeView control produced similar WINDOWS Explorer directory structure
    2022-07-15 18:15:02下载
    积分:1
  • bys
    这个只是一个开发项目的基本要求和数据库,希望大家在查阅的时候不要太生气,我也只是像找个更好的项目!(This is just a basic requirement for development projects and databases that we should not be too angry when accessible, I would just like to find a better project!)
    2010-09-13 13:18:23下载
    积分:1
  • QT5串口调试器
    QT5串口调试器,带报文自动应答,数据存储等功能
    2023-01-27 16:35:20下载
    积分:1
  • JinXiaoCun_CSharp_Code
    进销存管理系统,c#程序,功能比较完整的进销管理系统(Inventory management systems, c# program, complete management system into the sales)
    2013-04-03 21:11:02下载
    积分:1
  • 4轮驱动智能车stm32f103zet6源码
    包含红外线遥控,超声波避障,PID调速等多种功能,源码都有,F103zet6可以直接使用
    2022-01-25 21:19:09下载
    积分:1
  • c# development of logistics management software, program structure is strictly p...
    c#开发的物流行业管理软件,程序结构严禁,功能完善,很不错哦!-c# development of logistics management software, program structure is strictly prohibited, function perfect, very good oh!
    2022-03-05 09:44:45下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载