2021-09-09 13:13:37 索煒達(dá)電子 925
項(xiàng)目編號(hào):E933
文件大?。?08K
源碼說(shuō)明:帶中文注釋
開發(fā)環(huán)境:C編譯器
簡(jiǎn)要概述:
通過(guò)WiFi遠(yuǎn)程控制插座的開與關(guān),可遠(yuǎn)程操控插座的開啟與關(guān)閉。
a.采用0.96英寸OLED顯示屏顯示插座狀態(tài)信息與WiFi信息。
b.通訊模塊采用ESP8266WiFi模塊。
c.主控模塊采用STM32F103C8T6核心板。
d.執(zhí)行模塊采用單路光耦繼電器。
核心板使用串口與ESP8266進(jìn)行通信,接收WiFi模塊回傳的指令,從而控制繼電器的開與關(guān)。ESP8266使用AT固件,在初始化時(shí)配置成AP兼Station模式,使用TCP協(xié)議模擬成TCP服務(wù)端。PC端蓋通過(guò)鏈接WiFi模塊生成的熱點(diǎn),使用網(wǎng)絡(luò)調(diào)試助手即可與WiFi模塊通信。STM32核心板通過(guò)串口與WiFi模塊通信,并通過(guò)串口初始化WiFi模塊與接收指令。再對(duì)串口接收到的數(shù)據(jù)進(jìn)行判斷,控制IO口的電平從而起到對(duì)繼電器的控制。
程序流程圖
制作出來(lái)的實(shí)物圖如下:
目錄│文件列表:
└ WiFi智能插座
├ Libraries
│ ├ CMSIS
│ │ │ core_cm3.c
│ │ │ core_cm3.h
│ │ │ stm32f10x.h
│ │ │ system_stm32f10x.c
│ │ │ system_stm32f10x.h
│ │ └ startup
│ │ │ startup_stm32f10x_cl.s
│ │ │ startup_stm32f10x_hd.s
│ │ │ startup_stm32f10x_hd_vl.s
│ │ │ startup_stm32f10x_ld.s
│ │ │ startup_stm32f10x_ld_vl.s
│ │ │ startup_stm32f10x_md.s
│ │ │ startup_stm32f10x_md_vl.s
│ │ └ startup_stm32f10x_xl.s
│ └ FWlib
│ ├ inc
│ │ │ misc.h
│ │ │ stm32f10x_adc.h
│ │ │ stm32f10x_bkp.h
│ │ │ stm32f10x_can.h
│ │ │ stm32f10x_cec.h
│ │ │ stm32f10x_crc.h
│ │ │ stm32f10x_dac.h
│ │ │ stm32f10x_dbgmcu.h
│ │ │ stm32f10x_dma.h
│ │ │ stm32f10x_exti.h
│ │ │ stm32f10x_flash.h
│ │ │ stm32f10x_fsmc.h
│ │ │ stm32f10x_gpio.h
│ │ │ stm32f10x_i2c.h
│ │ │ stm32f10x_iwdg.h
│ │ │ stm32f10x_pwr.h
│ │ │ stm32f10x_rcc.h
│ │ │ stm32f10x_rtc.h
│ │ │ stm32f10x_sdio.h
│ │ │ stm32f10x_spi.h
│ │ │ stm32f10x_tim.h
│ │ │ stm32f10x_usart.h
│ │ └ stm32f10x_wwdg.h
│ └ src
│ │ misc.c
│ │ stm32f10x_adc.c
│ │ stm32f10x_bkp.c
│ │ stm32f10x_can.c
│ │ stm32f10x_cec.c
│ │ stm32f10x_crc.c
│ │ stm32f10x_dac.c
│ │ stm32f10x_dbgmcu.c
│ │ stm32f10x_dma.c
│ │ stm32f10x_exti.c
│ │ stm32f10x_flash.c
│ │ stm32f10x_fsmc.c
│ │ stm32f10x_gpio.c
│ │ stm32f10x_i2c.c
│ │ stm32f10x_iwdg.c
│ │ stm32f10x_pwr.c
│ │ stm32f10x_rcc.c
│ │ stm32f10x_rtc.c
│ │ stm32f10x_sdio.c
│ │ stm32f10x_spi.c
│ │ stm32f10x_tim.c
│ │ stm32f10x_usart.c
│ └ stm32f10x_wwdg.c
├ Output
│ │ bsp_led._2i
│ │ bsp_usart._2i
│ │ core_cm3._2i
│ │ misc._2i
│ │ oled._2i
│ │ stm32f10x_adc._2i
│ │ stm32f10x_bkp._2i
│ │ stm32f10x_can._2i
│ │ stm32f10x_cec._2i
│ │ stm32f10x_crc._2i
│ │ stm32f10x_dac._2i
│ │ stm32f10x_dbgmcu._2i
│ │ stm32f10x_dma._2i
│ │ stm32f10x_exti._2i
│ │ stm32f10x_flash._2i
│ │ stm32f10x_fsmc._2i
│ │ stm32f10x_gpio._2i
│ │ stm32f10x_i2c._2i
│ │ stm32f10x_iwdg._2i
│ │ stm32f10x_pwr._2i
│ │ stm32f10x_rcc._2i
│ │ stm32f10x_rtc._2i
│ │ stm32f10x_sdio._2i
│ │ stm32f10x_spi._2i
│ │ stm32f10x_tim._2i
│ │ stm32f10x_usart._2i
│ │ stm32f10x_wwdg._2i
│ │ system_stm32f10x._2i
│ │ USART.fed
│ │ USART.hex
│ │ USART.l2p
│ └ WiFi_KEY.hex
├ Project
│ └ RVMDK(uv5)
│ │ BH-F103.uvguix.86158
│ │ BH-F103.uvguix.XieSenshi
│ │ BH-F103.uvoptx
│ │ BH-F103.uvprojx
│ │ EventRecorderStub.scvd
│ ├ .vscode
│ │ │ c_cpp_properties.json
│ │ │ keil-assistant.log
│ │ └ uv4.log.lock
│ └ DebugConfig
│ │ USART_STM32F103C8_1.0.0.dbgconf
│ │ USART_STM32F103VE_1.0.0.dbgconf
│ │ WiFi_KEY_STM32F103C8_1.0.0.dbgconf
│ └ WiFi_KEY_STM32F103ZE_1.0.0.dbgconf
├ SYSTEM
│ ├ delay
│ │ │ delay.c
│ │ └ delay.h
│ ├ sys
│ │ │ sys.c
│ │ └ sys.h
│ └ usart
│ │ usart.c
│ └ usart.h
└ User
│ main.c
│ stm32f10x_conf.h
│ stm32f10x_it.c
│ stm32f10x_it.h
├ ESP8266
│ │ ESP8266.c
│ └ ESP8266.h
├ led
│ │ bsp_led.c
│ └ bsp_led.h
├ OLED
│ │ bmp.h
│ │ codetab.h
│ │ oled.c
│ └ oled.h
└ usart
│ bsp_usart.c
└ bsp_usart.h