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

  • msp-430
    说明:  msp430的中文手册,原理图,示例程序,来自合肥工业大学,请勿用于商业用途(Chinese manual, schematic diagram, sample program of msp430, from Hefei University of Technology, please do not use for commercial purposes)
    2020-06-18 16:20:02下载
    积分:1
  • sb
    说明:  网上找的一个有意思的程序。共享下。参阅下子(Internet is an interesting program. Sharing the next. See erupted)
    2011-09-28 11:03:06下载
    积分:1
  • CCppt
    Clear Case briefly introduction power point
    2013-09-25 10:03:02下载
    积分:1
  • spezializations-domain
    rossler混沌系统图像,u取不同参数时的6种混沌状态,很好(Rossler chaotic system image, when u get different parameters of 6 kinds of chaotic state, very good)
    2017-08-06 21:35:24下载
    积分:1
  • 019-图书管理器
    说明:  图书管理系统·: 用户可以用来添加书籍、查找书籍信息,该系统可用于图书的管理与查找(Library Management System Users can add books and find book information. The system can be used for book management and search.)
    2019-01-03 16:50:49下载
    积分:1
  • EmgucvTest
    用c#和emgucv实现了1.显示图像的直方图,2.直方图均衡化,3.中值滤波,4.sobel算子,roberts算子和Prewitt算子的边缘提取。各算法均自己实现不是调用函数。但是读图片的信息是用的emgucv。希望和同样刚接触emgucv的同学共同进步(With c# and emgucv achieve a 1 shows a histogram of the image, 2. Histogram equalization, 3 median filter, 4.sobel operator, edge roberts operator and Prewitt operator extraction. Various algorithms to achieve their own instead of calling a function. But reading the image information is used emgucv. The same hopes and common progress of students new to emgucv)
    2013-11-26 09:32:22下载
    积分:1
  • ado查询
    CString result,strsql,strcol,strColName,strtemp; _variant_t va,partment; CAdoDB db(TEXT("student")); strsql.Format("%s",B.strsql); db.ExecuteSQLSelect(strsql); int k=0,q=0; if(db.ResultExist()) { int totalnum=db.GetRecCount(); strtemp.Format("%d",totalnum); long nItemCount  =db.m_pRecordset->GetFields()->GetCount();  db.m_pRecordset->MoveFirst(); if(totalnumadoEOF) { for(long i=0;iGetFields()->GetItem(i)->GetName()); strcpy(B.AllInfo[i],db.GetRecordResult(strColName)); } B.OperState=totalnum;//总个数 Send(&B,sizeof(B)); db.m_pRecordset->MoveNext(); } } else {            while(q
    2022-06-20 20:45:23下载
    积分:1
  • stm32f103-rc522+hal
    说明:  main file with stm complete mfrc522 tested
    2019-02-23 13:41:28下载
    积分:1
  • Sources_KB
    freescale KeyBoard freescale KeyBoard freescale KeyBoard
    2009-03-04 16:20:59下载
    积分:1
  • failed to translate
    和好的 源程序 五角星-failed to translate
    2023-07-11 05:15:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载