标题:
基于stm32人体红外模块源码
[打印本页]
作者:
husy
时间:
2021-11-21 20:01
标题:
基于stm32人体红外模块源码
单片机源程序如下:
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"
#include "hc_sr501.h"
#include "adc.h"
int main(void)
{
u16 adcx;
float temp;
delay_init(); //延时函数初始化
LED_Init();
HC_SR();
uart_init(9600);
Adc_Init();
LED1=1;
//初始化与LED连接的硬件接口
while(1)
{
if(HC_SR501_Statue()==1)
{
printf("有人!\r\n");
delay_ms(1000);
}
else
{
printf("没人!\r\n");
delay_ms(1000);
}
}
复制代码
Keil代码下载:
人体红外.7z
(182.16 KB, 下载次数: 37)
2021-11-23 00:35 上传
点击文件名下载附件
下载积分: 黑币 -5
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1