#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 40
下载积分: 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语言实现的python里面的filtfilt函数
    说明:  使用C语言实现了零相滤波器算法程序,优化了资源(Zero phase filter program realized by C program)
    2021-03-18 17:29:19下载
    积分:1
  • gui_code_trans
    GB2312和UNICODE间的转换,使用转换表,应用于嵌入式系统,有转换函数。(GB2312, and UNICODE between the conversion using the conversion table used in embedded systems, conversion functions.)
    2013-03-27 17:21:05下载
    积分:1
  • Genetic-Algorithm
    遗传算法的理论、应用和软件实现。详细讲解了遗传算法的基础知识,并给出了实例及代码(Theory, application and software Genetic Algorithms)
    2015-11-18 20:02:16下载
    积分:1
  • chombo_package4
    说明:  自适应网格划分通用程序包,美国伯克利大学开发。(Adaptive Mesh generic package, the United States developed at the University of Berkeley.)
    2006-04-13 21:13:20下载
    积分:1
  • Ffpga-jpegP
    基于FPGA的JPEG图像压压缩,实现JPEG图像的实时压缩 (Real-time compression pressure compressed FPGA-based JPEG images, JPEG images)
    2012-08-23 22:11:39下载
    积分:1
  • 添加滑标控件
    添加滑标控件的VC的MFC 代码,提供学习使用,该代码展示了滑标控件的函数实现以及调用方式的完整代码,可供学习或者在MFC程序中写相关控件进行参考
    2023-03-16 00:10:04下载
    积分:1
  • headfile
    pcf8583时钟芯片 iic lcd显示时钟(pcf8583 clock chip iic lcd display clock)
    2010-05-15 19:50:57下载
    积分:1
  • Linux C语言编程一站式学习--pdf完整版
    说明:  这本书最初是为北京亚嵌教育研究中心的嵌入式Linux系统工程师就业班课程量身定做的教材之一。该课程是为期四个月的全日制职业培训,要求学员毕业时具备非常Solid的C编程能力,能熟练地使用Linux系统,同时对计算机体系结构与指令集、操作系统原理和设备驱动程序都有较深入的了解。(This book was originally one of the textbooks tailored for the Embedded Linux System Engineers course at the Beijing Institute of Embedded Education Research. The course is for a period of four Full-time vocational training for the month, requiring students to have very solid C programming skills when they graduate, skilled use of Linux systems, and computer architectureHave a deeper understanding of the instruction set, operating system principles and device drivers.)
    2020-10-07 18:27:37下载
    积分:1
  • MATLAB与Excel交互
    说明:  Matlab 如何通过命令的方式直接与Excel建立交互,使数据的操作灵活的显示在Excel。(How Matlab interacts directly with Excel through commands, making data manipulation flexible in Excel.)
    2020-06-21 00:40:02下载
    积分:1
  • LPC1700-IEC
    IEC60601-1-8音频报警标准提供了富有和声的音调,以便使它们容易定位、并能防止屏蔽的干扰。范畴与对应旋律的数量都有限,从而能获得容易掌握的不同报警顺序。另外,报警的优先权决定了报警中音符的数量,以及音符顺序的动态特征。这使得人们容易确定报警的紧急程度。这样,IEC60601-1-8标准解决了许多以前报警的限制因素,而且将有助于改善患者的安全性。(IEC60601-1-8 standard audio alarm provides a rich harmonic tone in order to make them easier to locate and prevent interference shielding. Areas and have limited the number corresponding to the melody, so that it can be easy to grasp the order of the different alarm. In addition, the alarm priority determines the number of alarm in the note, and note the order of the dynamic features. This makes it easy to determine the urgency of the alarm. This, IEC60601-1-8 standard solution before the alarm of many constraints, but will also help improve patient safety.)
    2010-06-04 22:01:51下载
    积分:1
  • 696518资源总数
  • 104271会员总数
  • 70今日下载