|
此貼是根據(jù)野火的程序修改的,只能控制一個(gè)DS18B20。
0.png (37.81 KB, 下載次數(shù): 162)
下載附件
2017-4-30 01:38 上傳
0.png (54.82 KB, 下載次數(shù): 144)
下載附件
2017-4-30 01:40 上傳
單片機(jī)源程序:
- /**
- ******************************************************************************
- * @file main.c
- * @author fire
- * @version V1.0
- * @brief WF-ESP8266 WiFi模塊測(cè)試
- ******************************************************************************
- * @attention
- *
- * 實(shí)驗(yàn)平臺(tái):野火 iSO STM32 開發(fā)板
- ******************************************************************************
- */
-
- #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); //將外設(shè)GPIOB寄存器重設(shè)為缺省值
- 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); //初始狀態(tài),熄滅指示亮
- }
- /**
- * @brief 主函數(shù)
- * @param 無
- * @retval 無
- */
- int main ( void )
- {
- /* 初始化 */
- LED_Configuration ();
- USARTx_Config (); //初始化串口1
- SysTick_Init (); //配置 SysTick 為 1ms 中斷一次
- ESP8266_Init (); //初始化WiFi模塊使用的接口和外設(shè)
- //DHT11_Init (); //初始化ds10b20
- …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼
下載:
向電腦網(wǎng)絡(luò)助手上傳 ds18b20 溫度禁止修改 已驗(yàn)證.rar
(757.5 KB, 下載次數(shù): 52)
2017-4-30 01:39 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
|