下载此文档

mpu6050详细C语言程序.docx


文档分类:IT计算机 | 页数:约16页 举报非法文档有奖
1/16
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/16 下载此文档
文档列表 文档介绍
实用文档
/****************************************************************************** *
陀螺仪 MPU6050 IIC CC_Configuration(void);
void GPIO_Configuration(void);
void NVIC_Configuration(void);
void USART1_Configuration(void);
void WWDG_Configuration(void);
void Delay(u32 nTime);
void Delayms(vu32 m);
/* 变量定义 ----------------------------------------------*/
/*******************************/
void DATA_printf(uchar *s,short temp_data)
{
if(temp_data<0){
temp_data=-temp_data;
*s='-';
}
else *s=' ';
*++s =temp_data/100+0x30;
temp_data=temp_data%100; // 取余运算
*++s =temp_data/10+0x30;
temp_data=temp_data%10; // 取余运算
文案大全
实用文档
*++s =temp_data+0x30;
}
/******************************************************************************
*
* Function Name : I2C_GPIO_Config
* Description : Configration Simulation IIC GPIO
* Input : None
* Output : None
Return: None
******************************************************************************
*/
void I2C_GPIO_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
= GPIO_Pin_6;
= GPIO_Speed_50MHz;
= GPIO_Mode_Out_OD;
GPIO_Init(GPIOB, &GPIO_InitStructure);
= GPIO_Pin_7;
= GPIO_Speed_50MHz;
= GPIO_Mode_Out_OD;
GPIO_Init(GPIOB, &GPIO_InitStructure);
}
/******************************************************************************
*
* Function Name : I2C_delay
* Description : Simulation IIC Timing series delay
* Input : None
* Output : None
Return: None
******************************************************************************
*/
void I2C_delay(void)
{
u8 i=30; // 这里可以优化速度 ,经测试最低到 5 还能写入
while(i)
{
i--;
}
文案大全
实用文档
}
vo

mpu6050详细C语言程序 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数16
  • 收藏数0 收藏
  • 顶次数0
  • 上传人爱的奉献
  • 文件大小28 KB
  • 时间2022-08-01