标题:
stm32HX711压力传感器程序
[打印本页]
作者:
3.355
时间:
2022-9-9 08:54
标题:
stm32HX711压力传感器程序
基于stm32f103的hx711的称重程序
单片机源程序如下:
/************************************************************************************
*************************************************************************************/
#include "stm32f10x.h"
#include "delay.h"
#include "HX711.h"
#include "usart.h"
int main(void)
{
Init_HX711pin();
delay_init();
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
uart_init(9600); //串口初始化为9600
Get_Maopi(); //称毛皮重量
delay_ms(1000);
delay_ms(1000);
Get_Maopi(); //重新获取毛皮重量
while(1)
{
Get_Weight();
printf("净重量 = %d g\r\n",Weight_Shiwu); //打印
delay_ms(1000);
}
}
复制代码
Keil代码下载:
Keil代码.7z
(187.57 KB, 下载次数: 43)
2022-9-9 14:07 上传
点击文件名下载附件
下载积分: 黑币 -5
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1