|
此貼是根據野火的程序修改的,只能控制一個DS18B20。
0.png (37.81 KB, 下載次數: 162)
下載附件
2017-4-30 01:38 上傳
0.png (54.82 KB, 下載次數: 144)
下載附件
2017-4-30 01:40 上傳
單片機源程序:
- /**
- ******************************************************************************
- * @file main.c
- * @author fire
- * @version V1.0
- * @brief WF-ESP8266 WiFi模塊測試
- ******************************************************************************
- * @attention
- *
- * 實驗平臺:野火 iSO STM32 開發板
- ******************************************************************************
- */
-
- #include "stm32f10x.h"
- #include "bsp_usart1.h"
- #include "bsp_SysTick.h"
- #include "bsp_esp8266.h"
- #include "test.h"
- #include "bsp_dht11.h"
-
- /**************************************************************************************
- * 描 述 : GPIO_DSB初始化
- * 入 參 : 無
- * 返回值 : 無
- **************************************************************************************/
- void LED_Configuration(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
-
- /* Enable the GPIO_LED Clock */
- RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB , ENABLE);
-
- GPIO_DeInit(GPIOB); //將外設GPIOB寄存器重設為缺省值
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOB, &GPIO_InitStructure);
-
- GPIO_ResetBits(GPIOB , GPIO_Pin_9); //初始狀態,熄滅指示亮
- }
- /**
- * @brief 主函數
- * @param 無
- * @retval 無
- */
- int main ( void )
- {
- /* 初始化 */
- LED_Configuration ();
- USARTx_Config (); //初始化串口1
- SysTick_Init (); //配置 SysTick 為 1ms 中斷一次
- ESP8266_Init (); //初始化WiFi模塊使用的接口和外設
- //DHT11_Init (); //初始化ds10b20
- …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼
下載:
向電腦網絡助手上傳 ds18b20 溫度禁止修改 已驗證.rar
(757.5 KB, 下載次數: 52)
2017-4-30 01:39 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|
|