一、实验目的
【实验一】实现Easy IoT配置。
【实验二】实现Easy IoT上mqtt消息的通讯。
二、实验原理和内容
实现mind+下Easy IoT上mqtt消息的通讯。
三、实验软硬件环境
硬件:掌控板
软件:Mind+
四、实验过程(实验步骤、记录、数据、分析)
3.核心代码截图:
(1) 模块化代码
(2) 具体代码
/*!
* MindPlus
* mpython
*
*/
#include <MPython.h>
#include <DFRobot_Iot.h>
// 函数声明
void obloqMqttEventT0(String& message);
void obloqMqttEventT1(String& message);
// 静态常量
const String topics[5] = {"-9ONus_Mg","jupHrslGg","","",""};
const MsgHandleCb msgHandles[5] = {obloqMqttEventT0,obloqMqttEventT1,NULL,NULL,NULL};
// 创建对象
DFRobot_Iot myIot;
// 主