Files

53 lines
1.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//**** 声明 ********************************************************************
/*******************************************************************************
* 下面来自互联开源程序,由深圳市大夏龙雀科技有限公司收集
* 方便用户参考学习,本公司不提供任何技术支持
* 程序仅供测试参考,不能应用在实际工程中,不一定能通过编译
* 公司网站 http://www.szdx-smart.com/
* 淘宝网址 https://shop184598174.taobao.com/?spm=a1z10.5-c-s.w12096189-21564973333.3.547b1176WCCDxR&scene=taobao_shop
*******************************************************************************/
/********************************************************************
* 文件名 WF24-UDP协议应用
* 描述 : 该文件实现WF24和单片机数据透传。
***********************************************************************/
/*
Name: UDP
Created: 2024/8/21
Author: WAM
*/
#include "main.h"
#define Control 1
int main()
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //设置中断优先级
USART2_Config(115200);
USART1_Config(115200);
OLED_Init();
GPIO_Config();
CONNECT_TO_UDP("DX-SMART","SMART@601");
Motor_Config();
OLED_ColorTurn(0);//0正常显示1 反色显示
OLED_DisplayTurn(0);//0正常显示 1 屏幕翻转显示
while(1)
{
#if Control
if(wifi.buff_flag == 1 && CONNECT_FLEG == 1)
{
WIFI_SEND((char *)wifi.BUFF);
//while(!WIFI_CheckAck("AT+MQTTPUBRAW=test-w,32,0,0\r\n","OK",2000)!=0);
//WIFI_SEND((char *)wifi.BUFF);
WIFI_BUFF_MEMSET();
}
#else
if(wifi.buff_flag == 1 && CONNECT_FLEG == 1)
{
wifi_rx_Control();
}
#endif
}
}