-
大小: 14.61MB文件類型: .zip金幣: 1下載: 0 次發布日期: 2023-07-31
- 語言: 其他
- 標簽: stm32??esp8266??smartconfig??
資源簡介
使用STM32和esp8266模組搭建的基于樂為物聯的物聯網系統, 代碼中包含esp8266 WiFi模塊的smartconfig配網、與樂為物聯建立長連接、NRF24L01mesh網絡,以及HMI串口屏的使用
代碼片段和文件信息
/**
??******************************************************************************
??*?@file????
??*?@author??Hua?long
??*?@version?V2.1.0
??*?@date????21-May-2017
??*?@brief???This?file?provides?all?the??****?functions.
??******************************************************************************
??*?@attention
??*
??*
??******************************************************************************
??*/
#include?“include.h“
extern?u8?NRF_RX_BUF[];? ?//NRF?接收緩存區
extern?char?*Heartbeat;
int?main(void)
{
char?led_flag=1flag=1;
? u8?i=0j=0;
SysTick_Init();
USART1_Init(7211520011);
USART2_Init(36960011);
USART3_Init(3611520012);
TIMx_Config(36TIM38002);?//TIM3定時10ms配合USART1接收中斷匹配
TIMx_Status(TIM3DISABLE); //關閉TIM3
//??IWDG_Init(41800); //看門狗10s
LED_Init();
Key_Init();
NRF24L01_Config();
??
mem_init(); //初始化內存池
?Delay_ms(1000);?
?usart3_printf(“\r\n?Init?successful\r\n“);
?IWDG_Feed();??
?blink_blink();
?printf(Heartbeat);?//send?heartbeat?
while(1)
{ ?
i++;
Delay_ms(20);
IWDG_Feed();
if(KEY1==0)
{
while(KEY1==0);
usart3_printf(“\r\nKEY1?has?been?passed\r\n“);
Smartconfig();
}
NRF_ReceiveAll(NRF_RX_BUF);
if(i>=50)??//1s
{
usart3_printf(“\r\n?OK?successful\r\n“);?
//-----把主機采集的數據同步到HMI顯示屏上------------------
HMI_SendVal(“n0“System.Temp);
Delay_ms(10);
HMI_SendVal(“n1“System.Humi);
Delay_ms(10);
HMI_SendVal(“bt0“System.LED1_Sta);
Delay_ms(10);
HMI_SendVal(“bt1“System.LED2_Sta);
Delay_ms(10);
HMI_SendVal(“bt2“System.LED3_Sta);
//-----主機向從機群發LED狀態--------------------------------
NRF_Send_LED(System.LED1_StaSystem.LED2_StaSystem.LED3_Sta);
i=0;??
j++;
if(j>=5)?//5s
{
Delay_ms(10);?
printf(Heartbeat);?//send?heartbeat?
Delay_ms(10);?
Lewei_Send();
Delay_ms(10);?
j=0;
}
}
}?
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\Control\
?????文件????????3100??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\Control\control.c
?????文件????????1633??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\Control\control.h
?????文件????????2217??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\include.h
?????文件????????2088??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\main.c
?????文件????????3434??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\stm32f10x_conf.h
?????文件???????11373??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\stm32f10x_it.c
?????文件????????2692??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\stm32f10x_it.h
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\system\
?????文件????????7537??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\system\system.c
?????文件????????2630??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\system\system.h
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\TFT_GUI\
?????文件???????25739??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\TFT_GUI\font.h
?????文件????????7354??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\TFT_GUI\GUI.c
?????文件????????2723??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\TFT_GUI\GUI.h
?????文件???????10735??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\APP\TFT_GUI\picture.h
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DHT11\
?????文件????????2033??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DHT11\DHT11.c
?????文件?????????606??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DHT11\DHT11.h
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DS18B20\
?????文件????????4291??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DS18B20\DS18B20.C
?????文件?????????850??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DS18B20\DS18B20.H
?????文件????????2557??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\DS18B20\單總線搭載多路DS18B20.txt
?????目錄???????????0??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\ESP8266\
?????文件????????4114??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\ESP8266\AP_Server.c
?????文件????????1560??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\ESP8266\AP_Server.h
?????文件????????5257??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\ESP8266\ESP8266.c
?????文件????????1909??2018-02-08?14:39??F103Project?V_Master?-?Hei?-?smartconfig穩定版\BSP\ESP8266\ESP8266.h
............此處省略497個文件信息
評論
共有 條評論