標(biāo)題:
stm32HX711壓力傳感器程序
[打印本頁]
作者:
3.355
時間:
2022-9-9 08:54
標(biāo)題:
stm32HX711壓力傳感器程序
基于stm32f103的hx711的稱重程序
單片機源程序如下:
/************************************************************************************
*************************************************************************************/
#include "stm32f10x.h"
#include "delay.h"
#include "HX711.h"
#include "usart.h"
int main(void)
{
Init_HX711pin();
delay_init();
NVIC_Configuration(); //設(shè)置NVIC中斷分組2:2位搶占優(yōu)先級,2位響應(yīng)優(yōu)先級
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);
}
}
復(fù)制代碼
Keil代碼下載:
Keil代碼.7z
(187.57 KB, 下載次數(shù): 43)
2022-9-9 14:07 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1