E = ∫ d E = ∫ k d q r 2 = k L ∫ d q r 2 E = \int dE = \int \frac{kdq}{r^2} = \frac{k}{L} \int \frac{dq}{r^2}E=∫dE=∫r2kdq=Lk∫r2dq
E = Q 2 π ϵ L 2 E = \frac{Q}{2\pi\epsilon L^2}E=2πϵL2Q
Γ ( n ) = ( n − 1 ) ! ∀ n ∈ N \Gamma(n) = (n-1)!\quad\forall n\in\mathbb NΓ(n)=(n−1)!∀n∈N
Γ ( z ) = ∫ 0 ∞ t z − 1 e − t d t . \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.Γ(z)=∫0∞tz−1e−tdt.
最近在玩Latex有没有一起的啊
HMI-Board以太网数据监视器
开发工具
RT-Thread Studio(固件开发、编译)
实践环节二:MQTT 软件包的使用
基于刚刚创建好的示例工程:
在 RT-Thread Setting 中搜索 Kawaii-mqtt
软件包,并使能mqtt test功能,
然后ctrl+s
拉取软件包到工程内:
示例代码:
将下面代码粘贴覆盖 packages/kawaii-mqtt-latest/test/test.c
实在不行是可以手动拖的。
#include <stdio.h> #include <stdint.h> #include <rtthread.h> #include <rtdevice.h> #include <board.h> #include "mqttclient.h" static void sub_topic_handle1(void* client, message_data_t* msg) { (void) client; KAWAII_MQTT_LOG_I("-----------------------------------------------------------------------------------"); KAWAII_MQTT_LOG_I("%s:%d %s()...\ntopic: %s\nmessage:%s", __FILE__, __LINE__, __FUNCTION__, msg->topic_name, (char*)msg->message->payload); KAWAII_MQTT_LOG_I("-----------------------------------------------------------------------------------"); } static int mqtt_publish_handle1(mqtt_client_t *client) { mqtt_message_t msg; memset(&msg, 0, sizeof(msg)); msg.qos = QOS0; msg.payload = (void *)"this is a kawaii mqtt test ..."; return mqtt_publish(client, "pub5323", &msg); } static char cid[64] = { 0 }; static void kawaii_mqtt_demo(void *parameter) { mqtt_client_t *client = NULL; rt_thread_delay(6000); mqtt_log_init(); client = mqtt_lease(); rt_snprintf(cid, sizeof(cid), "rtthread-5323", rt_tick_get()); mqtt_set_host(client, "broker.emqx.io"); mqtt_set_port(client, "1883"); mqtt_set_user_name(client, "RT-Thread"); mqtt_set_password(client, "012345678"); mqtt_set_client_id(client, cid); mqtt_set_clean_session(client, 1); KAWAII_MQTT_LOG_I("The ID of the Kawaii client is: %s ",cid); mqtt_connect(client); mqtt_subscribe(client, "sub5323", QOS0, sub_topic_handle1); while (1) { mqtt_publish_handle1(client); mqtt_sleep_ms(4 * 1000); } } int ka_mqtt(void) { rt_thread_t tid_mqtt; tid_mqtt = rt_thread_create("kawaii_demo", kawaii_mqtt_demo, RT_NULL, 2048, 17, 10); if (tid_mqtt == RT_NULL) { return -RT_ERROR; } rt_thread_startup(tid_mqtt); return RT_EOK; } MSH_CMD_EXPORT(ka_mqtt, Kawaii MQTT client test program);
编译,烧录固件到开发板中,使用 ifconfig
命令查看是否获取到IP地址:
输入 ka_mqtt
命令,等待连接MQTT服务器成功:
上位机软件配置
安装软件
安装MQTTX-Setup-1.9.6-x64.exe
软件
导入配置
打开MQTTX软件,按照下图选择导入tools/mqtt_tool 目录下的:RT-Threads.json 文件
注意:其中Client ID
需要修改为和其他人不同的数值,需要点击右侧的图标
注意:订阅和发布的topic需要和开发板上的topic保持一致(sub/pub+手机号后四位)
{
“temp”: 23,
“humi”: 20,
“lux”: 120
}
使用MQTT工具向开发板订阅的Topic发送数据:
开发板串口终端接收到此消息,并打印:
实践环节三:LVGL 以太网数据监视器
导入工程有以下两种方式,请任选其一即可(推荐方式一):
方式一:使用RT-Thread Studio
- 1、打开RT-Thread Studio 选择导入:
- 2、选择导入RT-Thread Studio项目到工作空间
- 3、选择fimeware目录下进行导入
- 4、点击编译按钮,等待编译完成
- 5、烧录固件
方式二:使用Keil MDK5
- 1、双击
project.uvprojx
文件打开项目 - 2、点击编译按钮,等待编译完成
- 3、点击下载按钮进行固件的烧录
Demo使用介绍
克隆该https://gitee.com/Rbb666/hmi-board-eth-monitor
仓库,进行
就先这样啦~
PS:
资料链接
RT-Thread Studio下载链接:
https://download_redirect.rt-thread.org/download/studio/RT-Thread_Studio_2.2.7-setup-x86_64.exe
SquareLine Studio下载链接:https://static.squareline.io/downloads/SquareLine_Studio_Windows_v1_3_2.zip
MQTTX 下载链接:
https://packages.emqx.net/MQTTX/v1.9.6/MQTTX-Setup-1.9.6-x64.exe
项目代码链接:
hmi-board-eth-monitor