diff --git a/docs/en/uiflow/advanced.md b/docs/en/uiflow/advanced.md index e189a9dc..833bfa18 100644 --- a/docs/en/uiflow/advanced.md +++ b/docs/en/uiflow/advanced.md @@ -1,4 +1,4 @@ -# remote control +# Remote Control __________________________ #### Function Description @@ -130,7 +130,9 @@ __________________________ #### Instructions >When the program runs to the Publish release block, the message is released. example: + >When the A button is pressed, a message is posted (the subject is "RGB" and the content is "open") + >When the B button is pressed, a message is posted (the subject is "RGB" and the content is "close") > @@ -182,4 +184,47 @@ __________________________ >When the B button is pressed, a message is posted (the subject is "RGB", the content is "close"), and the RGB bar is extinguished. +# WiFi +__________________________ + +#### Function Description + +>Wifi network settings. + +> + +>* __wifi connect__ +Establish a wifi connection. + +>* __wifi reconnect__ +If wifi is not connected, reconnect the connection. + +>* __wifi is connect__ +If wifi access returns true else ruturns false. + +>* __Connect to Wi-Fi SSID PASSWORD__ +Connect with ssid and password. + +### Instructions + +>Establish a wifi connection with ssid and password. + +> + + +# P2P + +>* __P2P Send To APIKey Msg__ +Establish a point-to-point connection based on mqtt,Remote with other M5Stack and you should input the APIkey and Message to send. + +>* __P2P Read__ +Establish a point-to-point connection,Read the Message form other M5Stack + +#### Instructions + +>Establish a point-to-point connection to the remote host and send a message,the other M5Stack. + +> + + diff --git a/docs/en/uiflow/data_structure.md b/docs/en/uiflow/data_structure.md index 3d7ea4ce..75fb2477 100644 --- a/docs/en/uiflow/data_structure.md +++ b/docs/en/uiflow/data_structure.md @@ -88,33 +88,82 @@ Specify a random range, each time it is executed, randomly generate an integer i +# Introducing a map +__________________________ +#### Function Description + +>Map is another variable container model that can store any type of object. + +> + +>* __creat map__ +Create key-value pairs of map. + +>* __map clear__ +clear key-value. + +>* __map contain key__ +Confirm if there is a key in map + +>* __get ken in map__ +Get the value of Specified key. + +>* __in map add key value__ +Add key-value in map. + +>* __in map set key value__ +change the value of key in map. + +>* __in map delete key__ +Delete specified key + +#### Instructions +>Add a create map to create an map, add some elements to the map, Specify keywords and values + +> + + # Introducing an array __________________________ #### Function Description + >If the variable is a container, the array is a collection of many containers. We can assign values to any of the variables in the array. + > + >* __length of__ Measure the length of the array (ie the number of elements in the array) + >* __X is empty__ Determine whether an array is empty. When it is established, the expression is True, otherwise it is False. + >* __in list find__ Array index, indexed positive or reverse specified element + >* __create empty list__ Add a value to set whether the judgment is true (for example, whether it is odd or even or prime), if it is true, it is True, otherwise it is False. + >* __create list with__ Customize an array + >* __in list get__ Get the index value of an index element + >* __in list get sub-list from__ Intercepting an element from an array as a new array + >* __icreat list with item repeated times__ Create an array and use the element to repeat a certain number of times to fill + >* __reverse__ Array in reverse order + >* __in list set as__ Set an index to the specified value in the array + >* __make list from text with delimiter__ Create an array from text, using a separator + #### Instructions >Add a create list to create an array, add some elements to the array, call iteratively or otherwise @@ -122,4 +171,78 @@ Create an array from text, using a separator > +# Introducing JSON +__________________________ +#### Function Description +>JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for people to read and write. + +> + +>* __dumps to json__ +Encode Python objects into JSON strings. + +>* __loads json__ +Decode an encoded JSON string into a Python object. + + +#### Instructions +>Creat a map dumps to json + +> + + +# Introducing TEXT +__________________________ +#### Function Description + +>Use these blocks for text processing and screen display. + +> + +>* __" "__ +Assign text or String + +>* __to UPPER CASE__ +Convert text to uppercase or lowercase. + +>* __in text get letter#__ +Get the specified character from the text. + +>* __count in__ +Find the number of occurrences of characters. + +>* __is empty__ +Returns whether it is empty text. + +>* __length of__ +Return text length. + +>* __print__ +Print text. + +>* __replace with in__ +Replace string of text. + +>* __trim spaces from both sides__ +Remove spaces from both sides. + +>* __Convert to str__ +Convert other types to strings. + +>* __" "+__ +String merging. + +>* __decode__ +Decode the string in the encoding format specified by encoding. + +>* __encode__ +Encodes the string in the encoding format specified by encoding. + +>* __Reduce to decimal places__ +Retain the specified number of decimal places. + +#### Instructions +> + +> \ No newline at end of file diff --git a/docs/en/uiflow/hardware.md b/docs/en/uiflow/hardware.md index 3d51f75c..57d1b1b7 100644 --- a/docs/en/uiflow/hardware.md +++ b/docs/en/uiflow/hardware.md @@ -96,3 +96,33 @@ Get the Angular velocity z position >The accelerometer could be used to create a game controlled by tilt or a device that can alert others if an elderly person falls down > + + +# POWER +__________________________ + +#### Feature introduction + +>Set power management charge or get power. + + +> + +>* __isCharging__ +Return whether it is charging + +>* __isChargeFull__ +Return whether full battery + +>* __setCharge__ +Set charging + +>* __get Battery Level__ +Return battery level + + +#### Usage + +>If the charge RGB is RED else BLACK + +> \ No newline at end of file diff --git a/docs/en/uiflow/introduction.md b/docs/en/uiflow/introduction.md index aec67fea..9e204da6 100644 --- a/docs/en/uiflow/introduction.md +++ b/docs/en/uiflow/introduction.md @@ -9,7 +9,7 @@ _________________________________ >Go to[m5stack.com](http://m5stack.com/)and download the driver for your OS[CP210X driver](http://m5stack.com/download/Driver/CP210x_VCP_Windows.zip) -> +> * __Installing the driver__ diff --git a/docs/image/Hardwares/POWER.png b/docs/image/Hardwares/POWER.png new file mode 100644 index 00000000..dccb5a38 Binary files /dev/null and b/docs/image/Hardwares/POWER.png differ diff --git a/docs/image/Hardwares/Power_user.gif b/docs/image/Hardwares/Power_user.gif new file mode 100644 index 00000000..ab86af41 Binary files /dev/null and b/docs/image/Hardwares/Power_user.gif differ diff --git a/docs/image/Network/P2PSend_user.gif b/docs/image/Network/P2PSend_user.gif new file mode 100644 index 00000000..88d02add Binary files /dev/null and b/docs/image/Network/P2PSend_user.gif differ diff --git a/docs/image/Network/network.png b/docs/image/Network/network.png new file mode 100644 index 00000000..aaec048e Binary files /dev/null and b/docs/image/Network/network.png differ diff --git a/docs/image/Network/wifi_user.gif b/docs/image/Network/wifi_user.gif new file mode 100644 index 00000000..9f404933 Binary files /dev/null and b/docs/image/Network/wifi_user.gif differ diff --git a/docs/image/Operation/JSON.png b/docs/image/Operation/JSON.png new file mode 100644 index 00000000..ce4576d5 Binary files /dev/null and b/docs/image/Operation/JSON.png differ diff --git a/docs/image/Operation/JSON_dump_user.gif b/docs/image/Operation/JSON_dump_user.gif new file mode 100644 index 00000000..22f66cef Binary files /dev/null and b/docs/image/Operation/JSON_dump_user.gif differ diff --git a/docs/image/Operation/TEXT_lower_user.gif b/docs/image/Operation/TEXT_lower_user.gif new file mode 100644 index 00000000..ffc092a3 Binary files /dev/null and b/docs/image/Operation/TEXT_lower_user.gif differ diff --git a/docs/image/Operation/Text.png b/docs/image/Operation/Text.png new file mode 100644 index 00000000..59f03f62 Binary files /dev/null and b/docs/image/Operation/Text.png differ diff --git a/docs/image/Operation/Text_user.gif b/docs/image/Operation/Text_user.gif new file mode 100644 index 00000000..db0f6292 Binary files /dev/null and b/docs/image/Operation/Text_user.gif differ diff --git a/docs/image/Operation/map.png b/docs/image/Operation/map.png new file mode 100644 index 00000000..d01d35b0 Binary files /dev/null and b/docs/image/Operation/map.png differ diff --git a/docs/image/Operation/map_creat_user.gif b/docs/image/Operation/map_creat_user.gif new file mode 100644 index 00000000..22f66cef Binary files /dev/null and b/docs/image/Operation/map_creat_user.gif differ diff --git a/docs/image/base/CP210X_DL.gif b/docs/image/base/CP210X_DL.gif new file mode 100644 index 00000000..f93ce48c Binary files /dev/null and b/docs/image/base/CP210X_DL.gif differ diff --git a/docs/image/base/CP210x_driver.png b/docs/image/base/CP210x_driver.png deleted file mode 100644 index a0b89d32..00000000 Binary files a/docs/image/base/CP210x_driver.png and /dev/null differ diff --git a/docs/zh_CN/uiflow/advanced.md b/docs/zh_CN/uiflow/advanced.md index 991542a8..6bd95dae 100644 --- a/docs/zh_CN/uiflow/advanced.md +++ b/docs/zh_CN/uiflow/advanced.md @@ -181,5 +181,49 @@ __________________________ >当按下B按钮时,进行消息发布(主题为"RGB",内容为"close"), RGB bar熄灭 +# WiFi +__________________________ + +#### 功能说明 + +>设置wifi网络 + +> + +>* __wifi connect__ +建立wifi网络 + +>* __wifi reconnect__ +wifi重新连接 + +>* __wifi is connect__ +返回wifi连接状态 + +>* __Connect to Wi-Fi SSID PASSWORD__ +设置SSID和密码 + +### 使用方法 + +>wifi连接指定的SSID + +> + + +# P2P + +>* __P2P Send To APIKey Msg__ +通过MQTT服务器验证APIKey发送消息实现点对点远程控制 + +>* __P2P Read__ +读取远程P2P发送的数据 + +#### 使用方法 + +>建立P2P并发送消息. + +> + + + diff --git a/docs/zh_CN/uiflow/data_structure.md b/docs/zh_CN/uiflow/data_structure.md index 23afdcb1..4e0fdb23 100644 --- a/docs/zh_CN/uiflow/data_structure.md +++ b/docs/zh_CN/uiflow/data_structure.md @@ -86,6 +86,40 @@ __________________________ > +# 字典 +__________________________ +#### 功能说明 + +>字典是一种可变容器,可以存储任意类型的变量. + +> + +>* __creat map__ +建立键值对 + +>* __map clear__ +清空字典 + +>* __map contain key__ +返回是否存在键 + +>* __get key in map__ +返回键的值 + +>* __in map add key value__ +在字典中添加键值对 + +>* __in map set key value__ +在字典中设置键值对 + +>* __in map delete key__ +删除指定的键 + +#### 使用方法 +>创建字典,添加键值对 + +> + # 引入数组 __________________________ @@ -122,4 +156,78 @@ __________________________ > +# JSON字符串 +__________________________ +#### 功能说明 +>JSON 是一种轻量级数据交互格式,方便数据传输与阅读 + +> + +>* __dumps to json__ +将python对象编码为JSON格式 + +>* __loads json__ +将JSON字符串解码为python对象 + + +#### 使用方法 +>建立字典转成JSON格式 + +> + + +# 文本 +__________________________ +#### 功能描述 + +>进行相关文本处理或字符串显示 + +> + +>* __" "__ +建立文本内容 + +>* __to UPPER CASE__ +将文本内容进行大写或小写转换 + +>* __in text get letter#__ +截取指定的文本内容 + +>* __count in__ +返回文本中指定字符出现的次数 + +>* __is empty__ +返回文本是否为空 + +>* __length of__ +返回文本长度 + +>* __print__ +打印文本 + +>* __replace with in__ +将文本内容进行替换 + +>* __trim spaces from both sides__ +删除字符串两边空格 + +>* __Convert to str__ +将其他格式转为字符串 + +>* __" "+__ +文本合并 + +>* __decode__ +将字符串解码为指定格式 + +>* __encode__ +将字符串编码为指定格式 + +>* __Reduce to decimal places__ +指定小数位数 + +#### Instructions +> + +> \ No newline at end of file diff --git a/docs/zh_CN/uiflow/hardware.md b/docs/zh_CN/uiflow/hardware.md index eefc7f11..412ac585 100644 --- a/docs/zh_CN/uiflow/hardware.md +++ b/docs/zh_CN/uiflow/hardware.md @@ -94,3 +94,33 @@ __________________________ >使用标签显示采集到的数据,或是将数据用作运算或逻辑判断 > + + +# 电源管理 +__________________________ + +#### 功能说明 + +>设置充电或者获取电量. + + +> + +>* __isCharging__ +返回充电状态 + +>* __isChargeFull__ +充满电返回true + +>* __setCharge__ +设置充电 + +>* __get Battery Level__ +返回电量水平 + + +#### 使用方法 + +>如果在充电RGB亮红灯 + +> \ No newline at end of file