Merge branch 'master' of github.com:m5stack/m5-docs
@@ -17,16 +17,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="faq-item">
|
||||
<h5 class="faq-title">Q2: Where can I buy M5Stack products?<p class="faq-button"></p></h5>
|
||||
<div class="faq-answer">
|
||||
<div>
|
||||
<a href="https://m5stack.com">M5Stack Official website</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="faq-item">
|
||||
<h5 class="faq-title">Q3: Where is the official information release platform? How to get first-hand news?<p class="faq-button"></p></h5>
|
||||
<div class="faq-answer">
|
||||
@@ -782,7 +772,8 @@ If it is an official program, it has been compiled and verified before uploading
|
||||
<span>
|
||||
After upgrading the MacOS Catalina version on some Mac computers, M5StickC cannot burn programs normally.
|
||||
<br>
|
||||
Solution: When programming, use DuPont cable to short-circuit G0 to GND
|
||||
Solution1: When programming, use DuPont cable to short-circuit G0 to GND.
|
||||
Solution2: <a href="https://forum.m5stack.com/topic/1591/m5stickc-atom-on-macos-catalina-can-t-upload-esp32-timed-out-waiting-for-packet-header-solution-solved">Use the update tool to update the device USB driver chip firmware</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,32 +74,59 @@
|
||||
|
||||
>2. After downloading the software, double-click to run the application, connect the M5 device to the computer through the data cable, select the port parameters, click **"Burn"** to burn the program (**For M5StickC, set the baud rate to 115200 or 750000**)
|
||||
|
||||
|
||||
## Instructions
|
||||
Before use, please make sure that the roverc is fully charged. Charging method: insert m5stickc into the roverc, and connect the USB cable for charging.
|
||||
Burn the easyloader firmware of Joyc and roverc with two M5StickC respectively. Insert Joyc and roverc respectively after burning. After power on, roverc will display the MAC address name and battery power. At the same time, Joyc will scan the MAC address name of roverc. Long press the a key of M5StickC on Joyc, and the work will be matched. Left rocker up and down control front and back, left and right control translation, right rocker left and right control steering.
|
||||
|
||||
## Usage
|
||||
Two M5StickCs will be burned into the EasyLoader firmware of JoyC and RoverC respectively. After burning, they will be inserted into JoyC and RoverC respectively. After booting, RoverC will display the hotspot name of "M5AP+2 bytes mac address", and JoyC will scan the mac address name of RoverC. Press and hold the Home button of the M5StickC on the JoyC for 3 seconds to start scanning the hotspot of the car, and the pairing is successful. After successful pairing, the link icon is highlighted in the upper left corner of the screen, and the joystick value is displayed on the screen. The left and right joysticks are controlled up and down, the left and right controls pan, and the right rocker controls the steering.
|
||||
|
||||
|
||||
MotorControl:
|
||||
|
||||
<table>
|
||||
<tr><td>Motor serial number</td><td>Register address</td><td>Parameter value</td></tr>
|
||||
<tr><td>01</td><td>0x00</td><td>-127~127</td></tr>
|
||||
<tr><td>02</td><td>0x01</td><td>-127~127</td></tr>
|
||||
<tr><td>03</td><td>0x02</td><td>-127~127</td></tr>
|
||||
<tr><td>04</td><td>0x03</td><td>-127~127</td></tr>
|
||||
</table>
|
||||
|
||||
## Example
|
||||
|
||||
### 1. Arduino
|
||||
?>1: This case uses RoverC and JoyC to realize wireless control through UDP communication. Please select the corresponding case program below according to the equipment you are using.
|
||||
|
||||
Use with JoyC HAT, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Hat/RoverC/Arduino/RoverC)
|
||||
<el-card class="box-card" style="margin-bottom:20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 22px; font-weight: bold;">Arduino</span>
|
||||
<i class="el-icon-s-management" style="float: right;"></i>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC/tree/master/examples/KIT/JoyC_%26_RoverC'><el-tag>M5StickC</el-tag></a>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC-Plus/tree/master/examples/KIT/JoyC_%26_RoverC'><el-tag>M5StickC Plus</el-tag></a>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
Use alone [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Application/RoverC_Arduino_Alone)
|
||||
- Note: Before use, please make sure that the roverc is fully charged. Charging method: insert m5stickc into the roverc, and connect the USB cable for charging.
|
||||
Burn the easyloader firmware of Joyc and roverc with two M5StickC respectively. Insert Joyc and roverc respectively after burning. After power on, roverc will display the MAC address name and battery power. At the same time, Joyc will scan the MAC address name of roverc. Long press the a key of M5StickC on Joyc, and the work will be matched. Left rocker up and down control front and back, left and right control translation, right rocker left and right control steering.
|
||||
|
||||
?>2: This case is a RoverC stand-alone control program, which is directly controlled by the main controller. Please select the corresponding case program below according to the equipment you are using.
|
||||
|
||||
<el-card class="box-card" style="margin-bottom:20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 22px; font-weight: bold;">Arduino</span>
|
||||
<i class="el-icon-s-management" style="float: right;"></i>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC/tree/master/examples/Hat/RoverC'><el-tag>M5StickC</el-tag></a>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC-Plus/blob/master/examples/Hat/RoverC_PRO/RoverC_PRO_Arduino_Alone/RoverC_PRO_Arduino_Alone.ino'><el-tag>M5StickC Plus</el-tag></a>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
## Protocol
|
||||
|
||||
- Protocol type I2C
|
||||
- I2C Address: **0x38**
|
||||
|
||||
```clike
|
||||
/*--------------------------------------------------------------------------------------------------*/
|
||||
| ROVERC_MOTOR_REG | 0x00-0x03
|
||||
| ------------------------------------------------------------------------------------------------
|
||||
| motor_1_reg[0] | R/W | Motor1 Speed value(-127~127)
|
||||
| motor_2_reg[1] | R/W | Motor2 Speed value(-127~127)
|
||||
| motor_3_reg[2] | R/W | Motor3 Speed value(-127~127)
|
||||
| motor_4_reg[3] | R/W | Motor4 Speed value(-127~127)
|
||||
/*----------------------------------------------------------------------------------------------------
|
||||
|
||||
```
|
||||
|
||||
### 2. UIFlow
|
||||
|
||||
|
||||
@@ -116,30 +116,73 @@ The PRO version provides a gripping mechanism controlled by a servo for gripping
|
||||
</div>
|
||||
|
||||
|
||||
MotorControl:
|
||||
|
||||
<table>
|
||||
<tr><td>Motor serial number</td><td>Register address</td><td>Parameter value</td></tr>
|
||||
<tr><td>01</td><td>0x00</td><td>-127~127</td></tr>
|
||||
<tr><td>02</td><td>0x01</td><td>-127~127</td></tr>
|
||||
<tr><td>03</td><td>0x02</td><td>-127~127</td></tr>
|
||||
<tr><td>04</td><td>0x03</td><td>-127~127</td></tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr><td>Servo number</td><td>Angle(Register address)</td><td>Parameter value</td><td>Pulse(Register address)</td><td>Parameter value</td></tr>
|
||||
<tr><td>01</td><td>0x10</td><td>0~180°</td><td>0x20</td><td>500~2500us</td></tr>
|
||||
<tr><td>02</td><td>0x11</td><td>0~180°</td><td>0x21</td><td>500~2500us</td></tr>
|
||||
</table>
|
||||
|
||||
## Example
|
||||
|
||||
### 1. Arduino
|
||||
?>1: This case uses RoverC and JoyC to realize wireless control through UDP communication. Please select the corresponding case program below according to the equipment you are using.
|
||||
|
||||
Use with JoyC HAT(without servo gripper), please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Hat/RoverC)
|
||||
Before use, please make sure that the RoverC is fully charged. Charging method: insert M5StickC/M5StickC Plus into the RoverC, and connect the USB cable for charging.Burn the easyloader firmware of JoyC and RoverC with two M5StickC respectively. Insert JoyC and RoverC respectively after burning. After power on, RoverC will display the MAC address name and battery level. At the same time, JoyC will scan for the MAC address of RoverC. Long press the Home button of M5StickC on Joyc, and the two will be paired. Left thumbstick controlls forward and back motion, left and right control translation, right thumbstick controls left and right steering.
|
||||
<el-card class="box-card" style="margin-bottom:20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 22px; font-weight: bold;">Arduino</span>
|
||||
<i class="el-icon-s-management" style="float: right;"></i>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC/tree/master/examples/KIT/JoyC_%26_RoverC'><el-tag>M5StickC</el-tag></a>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC-Plus/tree/master/examples/KIT/JoyC_%26_RoverC'><el-tag>M5StickC Plus</el-tag></a>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
Independent(with servo gripper) usage [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Application/RoverC_PRO_Arduino_Alone)
|
||||
- Note: Before use, please make sure that the roverc is fully charged. Charging method: insert m5stickc into the roverc, and connect the USB cable for charging.
|
||||
Burn the easyloader firmware of Joyc and roverc with two M5StickC respectively. Insert Joyc and roverc respectively after burning. After power on, roverc will display the MAC address name and battery power. At the same time, Joyc will scan the MAC address name of roverc. Long press the a key of M5StickC on Joyc, and the work will be matched. Left rocker up and down control front and back, left and right control translation, right rocker left and right control steering.
|
||||
|
||||
?>2: This case is a RoverC stand-alone control program, which is directly controlled by the main controller. Please select the corresponding case program below according to the equipment you are using.
|
||||
|
||||
<el-card class="box-card" style="margin-bottom:20px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 22px; font-weight: bold;">Arduino</span>
|
||||
<i class="el-icon-s-management" style="float: right;"></i>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC/tree/master/examples/Hat/RoverC'><el-tag>M5StickC</el-tag></a>
|
||||
</div>
|
||||
<div class="box-card-item">
|
||||
<a href='https://github.com/m5stack/M5StickC-Plus/blob/master/examples/Hat/RoverC_PRO/RoverC_PRO_Arduino_Alone/RoverC_PRO_Arduino_Alone.ino'><el-tag>M5StickC Plus</el-tag></a>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
## Protocol
|
||||
|
||||
- Protocol type I2C
|
||||
- I2C Address: **0x38**
|
||||
|
||||
```clike
|
||||
/*--------------------------------------------------------------------------------------------------*/
|
||||
| ROVERC_MOTOR_REG | 0x00-0x03
|
||||
| ------------------------------------------------------------------------------------------------
|
||||
| motor_1_reg[0] | R/W | Motor1 Speed value(-127~127)
|
||||
| motor_2_reg[1] | R/W | Motor2 Speed value(-127~127)
|
||||
| motor_3_reg[2] | R/W | Motor3 Speed value(-127~127)
|
||||
| motor_4_reg[3] | R/W | Motor4 Speed value(-127~127)
|
||||
/*----------------------------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------*/
|
||||
| ROVERC_SERVO_ANGLE_REG | 0x10-0x11
|
||||
| ------------------------------------------------------------------------------------------------
|
||||
| servo_1_reg[0] | R/W | SERVO1 Angle value(0-180)
|
||||
| servo_2_reg[1] | R/W | SERVO2 Angle value(0-180)
|
||||
/*----------------------------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------*/
|
||||
| ROVERC_SERVO_PULSE_REG | 0x20-0x23
|
||||
| ------------------------------------------------------------------------------------------------
|
||||
| servo_1_pulse_reg[0] | R/W | SERVO1 PULSE H value
|
||||
| servo_1_pulse_reg[1] | R/W | SERVO1 PULSE L value
|
||||
| servo_2_pulse_reg[2] | R/W | SERVO2 PULSE H value
|
||||
| servo_2_pulse_reg[3] | R/W | SERVO2 PULSE L value (pulse value:500-2500us)
|
||||
/*----------------------------------------------------------------------------------------------------
|
||||
|
||||
```
|
||||
|
||||
### 2. UIFlow
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ The power input interface is DC/9-24V, the motor drive current can reach 1.5A, a
|
||||
## Related Link
|
||||
|
||||
- [DRV8825 Datasheet](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/module/DRV8825_en.pdf)
|
||||
- [GRBL-Firmware](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/GRBL13.2-Module-Arduino-Library.zip)
|
||||
|
||||
## PinMap
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
<div class="product_pic"><img src="assets/img/product_pics/module/module_stepmotor_01.webp"> <img src="assets/img/product_pics/module/module_stepmotor_02.webp"></div>
|
||||
|
||||
<!-- <img src="assets/img/product_pics/module/module_stepmotor_04.webp" width="30%" height="30%"> -->
|
||||
|
||||
## Description
|
||||
|
||||
**STEPMOTOR** is used for stepper motor control. It is perfect for any motion project as it can drive up to 3 Stepper motors with **GRBL** control.
|
||||
@@ -38,6 +36,14 @@ Integrated 3 DRV8825, a simple but very powerful board that can control one bipo
|
||||
<td>Resources</td>
|
||||
<td>Parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DC Interface</td>
|
||||
<td>XT30</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Motor Interface</td>
|
||||
<td>HY2.0-4P</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Net weight</td>
|
||||
<td>24g</td>
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
# wifiCfg
|
||||
|
||||
>Use the API in the wifiCfg module to configure the device WiFi connection.
|
||||
|
||||
|
||||
```clike
|
||||
import wifiCfg
|
||||
|
||||
//Automatically connect to the saved WiFi, the screen displays the connection UI
|
||||
wifiCfg.autoConnect(lcdShow=True)
|
||||
|
||||
//Connect to the specified WiFi
|
||||
wifiCfg.doConnect(ssid, pwd)
|
||||
|
||||
//Connect to the specified WiFi and specify the connection timeout period
|
||||
wifiCfg.connect(ssid, pwd, timeout, block=False)
|
||||
|
||||
//WiFi reconnect
|
||||
wifiCfg.reconnect()
|
||||
|
||||
//Is it connected
|
||||
print(wifiCfg.wlan_sta.isconnected())
|
||||
|
||||
```
|
||||
|
||||
# M5mqtt
|
||||
|
||||
>Use the API in the M5mqtt module to connect to the mqtt server and subscribe to publish message content.
|
||||
|
||||
-Connect to mqtt server
|
||||
|
||||
```clike
|
||||
|
||||
from m5mqtt import M5mqtt
|
||||
|
||||
//Create connection instance
|
||||
m5mqtt = M5mqtt(
|
||||
client_id,
|
||||
server,
|
||||
port=0,
|
||||
user=None,
|
||||
password=None,
|
||||
keepalive=0,
|
||||
ssl=False,
|
||||
ssl_params=None
|
||||
)
|
||||
|
||||
//Start connection
|
||||
m5mqtt.start()
|
||||
|
||||
while True:
|
||||
|
||||
|
||||
```
|
||||
|
||||
-Subscribe and publish news
|
||||
|
||||
```clike
|
||||
|
||||
//Subscribe news
|
||||
def callback(topic_data):
|
||||
print(topic_data)
|
||||
|
||||
m5mqtt.subscribe(topic, callback)
|
||||
|
||||
|
||||
//release the news
|
||||
m5mqtt.publish(topic, data)
|
||||
|
||||
```
|
||||
|
||||
-Other configurations
|
||||
|
||||
```clike
|
||||
|
||||
//Configure the client will message
|
||||
m5mqtt.set_last_will(topic, msg)
|
||||
|
||||
//Disconnect
|
||||
m5mqtt.deinit()
|
||||
|
||||
```
|
||||
|
||||
# ESP-NOW
|
||||
|
||||
>Using ESP-NOW technology to wirelessly transmit data to other ESP32 master control devices
|
||||
|
||||
```clike
|
||||
import espnow
|
||||
|
||||
//initialization
|
||||
espnow.init()
|
||||
|
||||
//Set the channel
|
||||
|
||||
//Get the local mac_addr
|
||||
espnow.get_mac_addr()
|
||||
|
||||
//broadcast
|
||||
espnow.broadcast(data='Hello')
|
||||
|
||||
//Set the peer list
|
||||
espnow.add_peer(slave_mac_addr, id)
|
||||
|
||||
//send messages
|
||||
espnow.send(id, data='World')
|
||||
|
||||
//Send message callback
|
||||
def send_cb(flag):
|
||||
if flag:
|
||||
print('succeed')
|
||||
else:
|
||||
print('Failed')
|
||||
|
||||
espnow.send_cb(send_cb)
|
||||
|
||||
//Receive message callback
|
||||
def recv_cb():
|
||||
//retrieve data
|
||||
sender_address, _, receive_data = espnow.recv_data(encoder='str')
|
||||
|
||||
espnow.recv_cb(recv_cb)
|
||||
|
||||
```
|
||||
# HTTP
|
||||
|
||||
>Use the API in the HTTP module to send HTTP requests to the server to obtain data.
|
||||
|
||||
```clike
|
||||
import urequests
|
||||
|
||||
//GET request
|
||||
req = urequests.request(
|
||||
method='GET',
|
||||
url='http://api.m5stack.com/v1',
|
||||
headers={'Content-Type':'text/html'}
|
||||
)
|
||||
|
||||
//POST request
|
||||
req = urequests.request(
|
||||
method='POST',
|
||||
url='http://api.m5stack.com/v1',
|
||||
json={'KEY':'VALUE'},
|
||||
headers={'Content-Type':'text/html'}
|
||||
)
|
||||
|
||||
//Get the response body status code
|
||||
print(req.status_code)
|
||||
|
||||
//Get the response body Reason-Phrase
|
||||
print(req.reason)
|
||||
|
||||
//Get the native response body
|
||||
print(req.content)
|
||||
|
||||
//Get response body string
|
||||
print(req.text)
|
||||
|
||||
//Get response body JSON
|
||||
print(req.json)
|
||||
|
||||
```
|
||||
|
||||
# NTP
|
||||
|
||||
>Get current time information through NTP server.
|
||||
|
||||
```clike
|
||||
|
||||
import ntptime
|
||||
|
||||
|
||||
//Set up NTP server
|
||||
//eg:
|
||||
//ntp = ntptime.client(host='jp.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='sg.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='tw.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='hk.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='tw.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='hk.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='us.pool.ntp.org', timezone=8)
|
||||
//ntp = ntptime.client(host='de.pool.ntp.org', timezone=8)
|
||||
|
||||
ntp = ntptime.client(host='cn.pool.ntp.org', timezone=8)
|
||||
|
||||
//Get the timestamp
|
||||
ntp.getTimestamp()
|
||||
|
||||
//Format the date
|
||||
ntp.formatDate('-')
|
||||
|
||||
//Format the time
|
||||
ntp.formatTime('-')
|
||||
|
||||
//Format date & time
|
||||
ntp.formatDatetime('-',':')
|
||||
|
||||
ntp.year()
|
||||
ntp.month()
|
||||
ntp.day()
|
||||
ntp.hour()
|
||||
ntp.minute()
|
||||
ntp.second()
|
||||
ntp.weekday()
|
||||
|
||||
```
|
||||
|
||||
|
||||
# EEPROM
|
||||
|
||||
>Save data persistently through EEPROM.
|
||||
|
||||
```clike
|
||||
|
||||
import nvs
|
||||
|
||||
//data input
|
||||
nvs.write_str(KEY, VALUE)
|
||||
|
||||
//Read data
|
||||
nvs.read_str(KEY)
|
||||
|
||||
```
|
||||
|
||||
# UART
|
||||
|
||||
>Send and receive data via UART.
|
||||
|
||||
```clike
|
||||
|
||||
//Create a serial port instance
|
||||
uart1 = machine.UART(1, tx=1, rx=3)
|
||||
|
||||
//Initialize the serial port
|
||||
uart1.init(115200, bits=8, parity=None, stop=1)
|
||||
|
||||
//Is there any content in the cache?
|
||||
uart1.any()
|
||||
|
||||
//Read the content in the buffer area
|
||||
uart1.read()
|
||||
|
||||
//Write content to the serial port
|
||||
uart1.write('Hello')
|
||||
|
||||
//Read/write case
|
||||
while True:
|
||||
if uart1.any():
|
||||
print(uart1.read())
|
||||
uart1.write('Hello')
|
||||
|
||||
```
|
||||
|
||||
# SD-Card
|
||||
|
||||
```clike
|
||||
|
||||
import os
|
||||
|
||||
//Read file
|
||||
with open('/sd/FileName.*','r') as fs:
|
||||
print(fs.read())
|
||||
|
||||
//Write file
|
||||
with open('/sd/test.txt','w+') as fs:
|
||||
fs.write('Hello World')
|
||||
|
||||
//File read and write mode
|
||||
w is opened for writing,
|
||||
w+ open in read-write mode
|
||||
r open in read mode
|
||||
r+ open in read-write mode
|
||||
a Open in append mode
|
||||
|
||||
//Set the file cursor
|
||||
fs.seek(0)
|
||||
|
||||
//View catalog
|
||||
os.listdir('/sd/DirectoryPath')
|
||||
|
||||
//Determine whether the path is a file
|
||||
os.stat('/sd/FilePath')[0] == 0x8000)
|
||||
|
||||
//Determine whether the path is a directory
|
||||
os.stat('/sd/DirectoryPath')[0] == 0x4000)
|
||||
|
||||
//Determine whether the file exists in the specified directory
|
||||
'FileName.*' in os.listdir('/sd/DirectoryPath')
|
||||
|
||||
```
|
||||
@@ -59,13 +59,28 @@ const unit = {
|
||||
"id":"unit_api"
|
||||
};
|
||||
|
||||
const advanced = {
|
||||
'title':"Advanced",
|
||||
'item':{
|
||||
'WiFi':'#/en/mpy/advanced?id=wificfg',
|
||||
'MQTT':'#/en/mpy/advanced?id=m5mqtt',
|
||||
'ESP-NOW':'#/en/mpy/advanced?id=esp-now',
|
||||
'HTTP':'#/en/mpy/advanced?id=http',
|
||||
'NTP':'#/en/mpy/advanced?id=ntp',
|
||||
'EEPROM':'#/en/mpy/advanced?id=eeprom',
|
||||
'UART':'#/en/mpy/advanced?id=uart'
|
||||
},
|
||||
"id":"advanced_api"
|
||||
};
|
||||
|
||||
var arduino_home_page = new Vue({
|
||||
el:'#arduino_home_page',
|
||||
data() {
|
||||
return {
|
||||
list: {
|
||||
quickstart: quickstart,
|
||||
unit: unit
|
||||
unit: unit,
|
||||
advanced: advanced
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -404,7 +404,11 @@ Set the sampling channel pin
|
||||
Set the sampling width
|
||||
|
||||
* __set atten__
|
||||
Set gain
|
||||
Set attenuation on the input of the ADC
|
||||
* ADC.ATTN_0DB: 0dB attenuation, gives a maximum input voltage of 1.00v - this is the default configuration
|
||||
* ADC.ATTN_2_5DB: 2.5dB attenuation, gives a maximum input voltage of approximately 1.34v
|
||||
* ADC.ATTN_6DB: 6dB attenuation, gives a maximum input voltage of approximately 2.00v
|
||||
* ADC.ATTN_11DB: 11dB attenuation, gives a maximum input voltage of approximately 3.6v
|
||||
|
||||
* __read value__
|
||||
read ADC
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# UIFlow Tencent Cloud access
|
||||
|
||||
## Overview
|
||||
|
||||
>This tutorial will take the building of temperature and humidity collection nodes as an example to demonstrate how to access the Tencent Cloud platform through the UIFlow programming device.
|
||||
|
||||
## Create project
|
||||
|
||||
>Before accessing, register and log in to [Tencent Cloud-IoT Development Platform](https://console.cloud.tencent.com/iotexplorer), click `Public instance`->`New project`->` to fill in the project Name/Description`->`Save`
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_01.webp" width="70%">
|
||||
<img src="/image/iotcloud/tencent/create_project_02.webp">
|
||||
|
||||
## Create a product
|
||||
|
||||
>The product can be understood as a collection of a certain type of equipment, and the user manages all the equipment under it through the product. `Click the item created in the previous step`->`Enter the product development center`->`New product`->`Define your product`->`Fill in the basic product information`->`Save`.
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_03.webp" width="45%">
|
||||
|
||||
?>The basic product information settings are shown in the figure, where the name can be customized, and other suggestions are consistent.
|
||||
|
||||
## Data Template
|
||||
|
||||
>The data template constructs its digital model by digitally describing the physical entity equipment. Defining data templates on the IoT development platform means defining product functions. After the function definition is completed, the system will automatically generate the data template of the product. Since we choose a custom product, there is no standard function. We need to define the function ourselves. `Click on the created product`->`New function`.
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_04.webp" width="70%">
|
||||
|
||||
|
||||
>As shown in the figure below, define the temperature and humidity functions separately. In actual application, you can also add more function definitions according to your needs
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_05.webp" width="45%">
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_06.webp" width="45%">
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_07.webp" width="70%">
|
||||
|
||||
## New device
|
||||
|
||||
>Complete the function definition, click the above steps `Device debugging`->`Click New Device`->`Fill in the device name`->`Save`. Click on the successfully created device to view the details page. (It will contain the key and device-related information needed for UIFlow connection)
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_08.webp">
|
||||
|
||||
-------------------------------------------------- ---------
|
||||
|
||||
<img src="/image/iotcloud/tencent/create_project_09.webp" width="70%">
|
||||
|
||||
|
||||
## Burn firmware
|
||||
|
||||
>Burn UIFlow firmware for your device (firmware requires v1.7.3 and above), click the corresponding document link below to view the detailed programming steps.
|
||||
|
||||
[UIFlow firmware burning steps](/zh_CN/quick_start/m5core/m5stack_core_get_started_MicroPython)
|
||||
|
||||
## Programming
|
||||
|
||||
-[Click to download the case program m5f file](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/m5f/UIFlow-Tencent-Core2.m5f), open the file in UiFlow, or follow Drag and drop the code block in the figure below.
|
||||
|
||||
```clike
|
||||
product id: Product ID, which can be viewed on the device information interface
|
||||
device name: device name, same as above
|
||||
device sceret: device secret key, same as above
|
||||
keepalive: heartbeat time 0 ~ 120 (seconds)
|
||||
```
|
||||
|
||||
<img src="/image/iotcloud/tencent/block_example.webp">
|
||||
|
||||
- Micropython API
|
||||
|
||||
```clike
|
||||
|
||||
from IoTcloud.Tencent import Tencent
|
||||
|
||||
//Initialize connection
|
||||
tencent = Tencent(
|
||||
product_id='XXXXXXXXXXX',
|
||||
device_name='XXXXXXX',
|
||||
username='XXXXXXXXXXXXXXXXXX;12010126;B335D;1702277766',
|
||||
password='e822dc0027a1b363f9ed1a23fb77860c0b707d7d;hmacsha1',
|
||||
port=1883,
|
||||
keepalive=30
|
||||
)
|
||||
|
||||
//upload data
|
||||
tencent.publish_property_msg(temperature=temp,humidity=humid)
|
||||
|
||||
|
||||
//Downstream data callback
|
||||
def tencent_fun(property_data):
|
||||
print(property_data)
|
||||
|
||||
//Subscribe to the platform to send messages
|
||||
tencent.subscribe_property_msg(tencent_fun)
|
||||
|
||||
```
|
||||
|
||||
## View data in the background
|
||||
|
||||
>The code block below is used to push data to the cloud platform, and the data is sent in the form of `key-value`, where the `key` value needs to be consistent with the `identifier` in the custom function. When the device is running, the user can view the upstream data of the device in the device log.
|
||||
|
||||
<img src="/image/iotcloud/tencent/publish_block.webp" width="45%">
|
||||
|
||||
<img src="/image/iotcloud/tencent/device_upload_log.webp">
|
||||
|
||||
## Mini Program to view data
|
||||
|
||||
>Tencent Cloud Service is integrated and docked with the small program `Tencent Lianlian`, and users can easily view the reported data of the device through the small program. `Device List`->`Device QR Code`. (Open the WeChat applet `Tencent Lianlian`, click on the `+` number to scan the code to bind the device).
|
||||
|
||||
<img src="/image/iotcloud/tencent/device_qrcode.webp">
|
||||
|
||||
<img src="/image/iotcloud/tencent/wechat_applets.webp" width="35%">
|
||||
|
||||
<script>
|
||||
|
||||
anchor_search();
|
||||
scrollFunc();
|
||||
|
||||
</script>
|
||||
@@ -40,6 +40,14 @@ const quickstart = {
|
||||
"id":"quickstart"
|
||||
};
|
||||
|
||||
const iotcloud = {
|
||||
'title':"IoT-Cloud",
|
||||
'item':{
|
||||
'Tencent':'#/en/uiflow/iotcloud/tencent'
|
||||
},
|
||||
"id":"iotcloud"
|
||||
};
|
||||
|
||||
const hardware = {
|
||||
'title':"Hardware",
|
||||
'item':{
|
||||
@@ -199,6 +207,7 @@ var uiflow_home_page = new Vue({
|
||||
return {
|
||||
list: {
|
||||
quickstart: quickstart,
|
||||
iotcloud: iotcloud,
|
||||
hardware: hardware,
|
||||
uielements: uielements,
|
||||
datastructure: datastructure,
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
## Include
|
||||
|
||||
- 1x Catch Unit
|
||||
- 1x Catch Unit(Built-in Servo-SG92R)
|
||||
- 1x HY2.0-4 adapter
|
||||
- 1x RoverC.Pro Connector
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ It is very easy to program by Single-BUS with simple protocol.
|
||||
|
||||
Another feature is the extension and flexibility, It's possible to connect many of them up together to create a massive long LED display. It's important to note that, the brightness and the quantity of LEDs matters the most to the power consuming, if you have a bunch of them connected up, you will need extra power supply.
|
||||
|
||||
*Notice: please pay attention to the direction of the input port and output port*
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_neopixel_02.webp">
|
||||
?>Note: The black PCB board at the end of the light bar is for the light bar signal input (connect to the M5Core), and the white PCB board is used to extend the light bar.
|
||||
|
||||
## Product Features
|
||||
|
||||
@@ -33,6 +31,30 @@ Another feature is the extension and flexibility, It's possible to connect many
|
||||
<td>Resources</td>
|
||||
<td>Parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lamp bead model</td>
|
||||
<td>SK6812</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Working voltage</td>
|
||||
<td>5V</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Power</td>
|
||||
<td>18W/m</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Data transfer rate</td>
|
||||
<td>800K/s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Working temperature</td>
|
||||
<td>-40°C-80°C</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Waterproof rating</td>
|
||||
<td>Bare board-not waterproof</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Net weight</td>
|
||||
<td>4g/6g/10g/12g/34g</td>
|
||||
@@ -83,17 +105,12 @@ Another feature is the extension and flexibility, It's possible to connect many
|
||||
|
||||
- [Click here to download the Arduino example](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/RGB_LED_SK6812/display_rainbow)
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/NEOPIXEL/example_unit_neopixel_02.webp">
|
||||
|
||||
### 2. UIFlow
|
||||
|
||||
To get the complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/NEOPIXEL/UIFlow)
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/NEOPIXEL/example_unit_neopixel_01.webp">
|
||||
|
||||
<!-- ## Schematic -->
|
||||
|
||||
<!-- <img src="assets/img/product_pics/unit/neopixel_sch.JPG"> -->
|
||||
|
||||
<el-divider content-position="right">Last updated: 2020-12-14</el-divider>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 38 KiB |