Merge branch 'master' of github.com:m5stack/m5-docs

This commit is contained in:
Sean
2020-07-07 18:11:15 +08:00
25 changed files with 1155 additions and 88 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

+127
View File
@@ -0,0 +1,127 @@
# IMU
*IMU automatically call different IMU models according to different configurations*
## Init()
**Syntax:**
<mark>int Init(void);</mark>
**Descriptioninitialize IMU**
**Example**
```arduino
#include <M5StickC.h>
void setup() {
M5.begin();
int x = M5.IMU.Init(); //return 0 is ok, return -1 is unknow
Serial.println(x);
}
void loop() {}
```
## getGyroData()
**Syntax:**
<mark>void getGyroData(float *gx, float *gy, float *gz);</mark>
**DescriptionObtain the three-axis gyroscope data of the IMU chip.**
**Example**
```arduino
#include <M5StickC.h>
float gyroX, gyroY, gyroZ;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getGyroData(&gyroX, &gyroY, &gyroZ);
M5.Lcd.setCursor(0, 30);
M5.Lcd.printf("X:%7.2f\nY:%7.2f\nZ:%7.2f ", gyroX, gyroY, gyroZ);
delay(500);
}
```
## getAccelData()
**Syntax:**
<mark>void getAccelData(float *ax, float *ay, float *az);</mark>
**DescriptionObtain the three-axis accelerometer data of the IMU chip.**
**Example**
```arduino
#include <M5StickC.h>
float accX, accY, accZ;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getAccelData(&accX, &accY, &accZ);
M5.Lcd.setCursor(0, 45);
M5.Lcd.printf("X:%5.2f\nY:%5.2f\nZ:%5.2f ", accX, accY, accZ);
delay(500);
}
```
## getAhrsData()
**Syntax**
<mark>void getAhrsData(float *pitch, float *roll, float *yaw);</mark>
**DescriptionGet the attitude of the IMU chip.**
**Example**
```arduino
#include <M5StickC.h>
float pitch, roll, yaw;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getAhrsData(&pitch, &roll, &yaw);
M5.Lcd.setCursor(0, 45);
M5.Lcd.printf("X:%5.2f\nY:%5.2f\nZ:%5.2f ", pitch, roll, yaw);
delay(500);
}
```
## getTempData()
**Syntax**
<mark>void getTempData(float *t);</mark>
**DescriptionGet the temperature of the IMU chip.**
**Example**
```arduino
#include <M5StickC.h>
float temp;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getTempData(&temp);
M5.Lcd.setCursor(0, 45);
M5.Lcd.printf("Temperature : %.2f C", temp);
delay(500);
}
```
+48
View File
@@ -0,0 +1,48 @@
# PWM
*PWM used to generate analog signals to drive servos or buzzers,etc.*
## ledcSetup()
**Syntax:**
<mark>void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);</mark>
**DescriptionSet the PWM channel, frequency and resolution.**
## ledcAttachPin()
**Syntax:**
<mark>void ledcAttachPin(uint8_t pin, uint8_t channel);</mark>
**DescriptionBind the LEDC channel to the specified IO port to achieve output.**
## ledWrite()
**Syntax**
<mark>void ledcWrite(uint8_t channel, uint32_t duty);</mark>
**DescriptionOutput waveform to the channel channel according to the specified duty cycle.**
**Example**
```arduino
#include <M5StickC.h>
int freq = 1800;
int channel = 0;
int resolution_bits = 8;
int buzzer = 2;
void setup() {
M5.begin();
ledcSetup(channel, freq, resolution_bits);
ledcAttachPin(buzzer, channel);
}
void loop() {
ledcWrite(channel, 128);
delay(1000);
ledcWrite(channel, 0);
delay(1000);
}
```
+2 -2
View File
@@ -17,5 +17,5 @@
|||
|:---:|:---:|
|**[System](en/api/system_m5stickc)** | **[Power Management(AXP192)](en/api/axp192_m5stickc)** |
|**[TFT Screen](en/api/lcd_m5stickc)** | **[IMU(SH200Q)](en/api/sh200q_m5stickc)** |
|**[RTC](en/api/rtc)**|
|**[TFT Screen](en/api/lcd_m5stickc)** | **[IMU](en/api/imu)** |
|**[RTC](en/api/rtc)**| | **[PWM](en/api/pwm)** |
+6 -7
View File
@@ -21,8 +21,8 @@
- 1x Proto Board
- 1x Proto Board(soldered pin/finished product)
- 1x 4P VH-3.96 Plug + Plug Base
- 1x 4P 2.0 Pins
- 1x 5P 2.0 Pins
- 1x 4P 2.54 Pins
- 1x 5P 2.54 Pins
- 1x ATOMIC Case
- 1x M2*3mm Hexagon self tapping screw
- 1x M2*8mm Hexagon socket cup head machine screw
@@ -45,11 +45,10 @@
</tr>
</thead>
<tbody>
<tr>
<tr>
<td>External port</td>
<td>VH-3.96 4P</td>
</tr>
<tr>
</tr>
<td>net weight</td>
<td>5g</td>
</tr>
@@ -59,7 +58,7 @@
</tr>
<tr>
<td>Product Size</td>
<td>24*24*17mm</td>
<td>24*24*18mm</td>
</tr>
<tr>
<td>Package Size</td>
@@ -67,7 +66,7 @@
</tr>
<tr>
<td>Case material</td>
<td>Plastic ( PC )</td>
<td>Plastic (PC)</td>
</tr>
</tbody>
</table>
+186
View File
@@ -0,0 +1,186 @@
# Base PoE
<div class="badge badge-pill badge-primary product_sku_tag">SKU:K012-C</div>
<div class="product_pic"><img src="assets/img/product_pics/base/w5500PoE/w5500PoE_01.webp"></div>
## Description
**Base PoE** is an M5 Base that implements a W5500 Ethernet controller chip with PoE module, which provides Hardwired TCP/IP embedded Ethernet control to facilitate easier internet connection to embedded systems. W5500 integrates TCP/IP protocol stack, 10/100M Ethernet data link layer (MAC) and physical layer (PHY).This base supports RS485 / RS232 communication and can be used as an Ethernet to serial port server. It is specifically designed for industrial applications. PoE (Power over Ethernet) technology is supported. Through the built-in PoE module, power can be directly supplied to the base through PoE hub / switch without a separate power supply. It comes with a couple of HT3.96 connectors, metal rail and magnet discs for easy installation. The 6 pins of the HT3.96 connector are spare, you can wire them up with an RS485 or RS232 adapter board as you like.
**The figure below shows the internals of the LAN base**
If you need to add an RS485 or RS232 interface, make sure to solder the RS485 or RS232 board onto the main board pin correspondingly.
<img src="assets/img/product_pics/base/w5500PoE/w5500PoE_04.webp" width = "50%">
### Product Features
- Support PoE IEEE802.3 AF/AT
- DC input supply voltage: 9-24V
- Ethernet access
- HT3.96 port for supporting RS485/RS232 communication
- 8 independent hardware socket simultaneous communication
- Support TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE protocols
- Support integrated 10BaseT / 100Base-T Ethernet PHY
- Easy to fixed on the wall
## Applications
- Ethernet controller
- Ethernet and RS485/RS232 data forwarding
- Ethernet network node
## Include
- 1x PoE Base
- 1x TTL-to-RS485 adapter board
- 1x TTL-to-RS232 adapter board
- 1x pin header 20pin
- 1x metal rails and magnet discs
- 3x HT3.96 terminal
- 2x 3pin
- 1x 4pin
- 10x cold crimp terminalred Copper Lugs
- 3x Allen wrench
  - 1x 1.5mm
  - 1x 2mm
  - 1x 2.5mm
- 2x hexagon socket head cap screws M3x28
- 4x hexagon socket tapping screw KA2x4
- 1x countersunk head screw M3x8
## Specification
<table>
<tr style="font-weight:bold">
<td>Resources</td>
<td>Parameter</td>
</tr>
<tr>
<td>Ethernet chip</td>
<td>W5500</td>
</tr>
<tr>
<td> Support protocols</td>
<td>TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE</td>
</tr>
<tr>
<td>RS485 chip</td>
<td>SP3485EE</td>
</tr>
<tr>
<td>RS232 chip</td>
<td>MAX232</td>
</tr>
<tr>
<td>PoE power supply mode</td>
<td>Idle network cable pin power supply(10M/100M Ethernet)J4&J5(VC-),J7&J8(VC+)</td>
</tr>
<tr>
<td>PoE specification</td>
<td>IEEE802.3 AF/AT</td>
</tr>
<tr>
<td>DC input voltage</td>
<td>9V~24V</td>
</tr>
<tr>
<td>Net weight</td>
<td>32g</td>
</tr>
<tr>
<td>Gross weight</td>
<td>132g</td>
</tr>
<tr>
<td>Product size</td>
<td>54*54*28mm</td>
</tr>
<tr>
<td>Package Size</td>
<td>105*65*4mm</td>
</tr>
</table>
## EasyLoader
>EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification. Please install the corresponding driver according to the device type. M5Core host [Please click here to view the CP210X driver installation tutorial](en/arduino/arduino_development), M5StickC/V/T/ATOM series can be used without driver)
<div class="easyloader-box">
<div style="background-color:white;">
<div><img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/easyloader_intro.webp"></div>
<div class="easyloader-btn">
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/Windows/BASE/EasyLoader_PoE_BASE.exe">Windows</a>
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/MacOS/BASE/EasyLoader_PoE_BASE.dmg">MacOS</a>
</div>
</div>
<div>
<video id="example_video" controls>
<source src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/video/Product_example_video/Base/PoE%20W5500.mp4" type="video/mp4">
</video>
<div class="easyloader-mask">
<a>
<svg id="play-btn" t="1583228776634" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4152" width="75" height="75"><path d="M512 0C229.216 0 0 229.216 0 512s229.216 512 512 512 512-229.216 512-512S794.784 0 512 0z m0 928C282.24 928 96 741.76 96 512S282.24 96 512 96s416 186.24 416 416-186.24 416-416 416zM384 288l384 224-384 224z" p-id="4153" fill="#007aff"></path></svg></a>
<p>Description:</p>
<p>Send messages or commands via Ethernet to control M5Stack 6060 PUSH or display messages on the screen</p>
</div>
</div>
</div>
### PinMap
<table class="table-1">
<thead>
<th>M5Stack</th>
<th>GPIO13</th>
<th>GPIO18</th>
<th>GPIO19</th>
<th>GPIO23</th>
<th>GPIO26</th>
<th>GPIO34</th>
<th>GPIO5</th>
<th>GPIO15</th>
</thead>
<tbody>
<tr>
<td>W5500 PoE</td>
<td>RST</td>
<td>CLK</td>
<td>MISO</td>
<td>MOSI</td>
<td>CS</td>
<td>INT</td>
<th>RX/A</th>
<th>TX/B</th>
</tr>
</tbody>
</table>
## Schematic
<img src="assets/img/product_pics/base/w5500PoE/w5500PoE.webp">
## Related Link
- **Datasheet**
- [W5500](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/base/W5500_datasheet_v1.0.2_1_en.pdf)
- [SP485EEN](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/hat/SP485EEN_en.pdf)
- [MAX232](hhttps://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/atombase/AtomicRS232/MAX232.pdf)
## Example
- Get Arduino code [click here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/W5500_PoE)
<script>
var purchase_link = 'https://m5stack.com/collections/m5-base/products/lan-module-w5500-with-poe';
anchor_search(purchase_link);
scrollFunc();
</script>
+5 -4
View File
@@ -72,7 +72,7 @@
</tr>
<tr>
<td>LCD screen</td>
<td>1.14 inch, 135*240 Colorful TFT LCD, ST7789</td>
<td>1.14 inch, 135*240 Colorful TFT LCD, ST7789v2</td>
</tr>
<tr>
<td>Button</td>
@@ -184,18 +184,19 @@ Power structure block diagram
**RED LED & IR Transmitter & BUTTON A & BUTTON B**
<table>
<tr><td>ESP32 </td><td>GPIO10</td><td>GPIO9</td><td>GPIO37</td><td>GPIO39</td></tr>
<tr><td>ESP32 </td><td>GPIO10</td><td>GPIO9</td><td>GPIO37</td><td>GPIO39</td><td>GPIO2</td></tr>
<tr><td>RED LED</td><td>LED Pin</td><td> </td><td> </td><td> </td></tr>
<tr><td>IR Transmitter</td><td> </td><td>Transmitter Pin</td><td> </td><td> </td></tr>
<tr><td>BUTTON A</td><td> </td><td> </td><td>Button Pin</td><td> </td></tr>
<tr><td>BUTTON B</td><td> </td><td> </td><td> </td><td>Button Pin</td></tr>
<tr><td>Buzzer</td><td> </td><td> </td><td> </td><td></td><td>Buzzer Pin</td></tr>
</table>
**TFT LCD**
Driver ICST7735S
Driver ICST7789v2
Resolution80 * 160
Resolution135 * 240
<table>
<tr><td>ESP32 </td><td>GPIO15</td><td>GPIO13</td><td>GPIO23</td><td>GPIO18</td><td>GPIO5</td></tr>
+204
View File
@@ -0,0 +1,204 @@
# M5CameraF New
<div class="badge badge-pill badge-primary product_sku_tag">SKU:U037</div>
<div class="product_pic"><img src="assets/img/product_pics/unit/m5camera_F_new/unit_m5camera_f_new_01.jpg"></div>
## Description
**M5CameraF** is a development board for image recognition. It features an ESP32(4M Flash + 520K RAM) chip and 2-Megapixel carmera(OV2640).**M5CameraF** offers plenty of storage, with an extra 4 Mbyte PSRAM. It also supports image transmission via Wi-Fi and debuging through USB Type-C port.
The hardware comes preloaded software, programmed by ESP-IDF. It is an application to run Wi-Fi camera. The output image is size 600*800, since it's 2-Maga camera, you sure can optimize the software to output the maximum size of photos.
what this software can do?
- Power the board via USB type-C or GROVE
- Use your phone to Wi-Fi scan an AP name start with 'm5stack-' and click to connect this AP.
- Open up web browser on your phone and visit <mark>192.168.4.1</mark>
- Then here comes the picture. Video is about 5-6 frames per senconds. not super fast.
## Product Features
- CP2104 USB-to-TTL converter
- ESP32-WROVER (PCB Antenna)
- WIFI image transmission
- OV2640 sensor
- Camera Field of View : **150 degree**
## Include
- 1x M5CameraF
- 1x LEGO Adapter
- 1x Wall/1515
- 1x Type-C USB(20cm)
<img src="assets/img/product_pics/unit/unit_m5camera_f_05.webp" width="50%" height="50%">
## Specification
<table>
<tr style="font-weight:bold">
<td>Resources</td>
<td>Parameter</td>
</tr>
<tr>
<td>Flash</td>
<td>4M</td>
</tr>
<tr>
<td>RAM</td>
<td>4MB</td>
</tr>
<tr>
<td>Image Sensor</td>
<td>OV2640</td>
</tr>
<tr>
<td>Maximum resolution</td>
<td>200w pixel</td>
</tr>
<tr>
<td>Output format</td>
<td>YUV(422/420)/YCbCr422,RGB565/555,8-bit compressed data,8-/10-bit Raw RGB data</td>
</tr>
<tr>
<td>Maximum image transmission rate</td>
<td>UXGA/SXGA: 15fps, SVGA: 30fps, CIF: 60fps</td>
</tr>
<tr>
<td>FOV</td>
<td>150°</td>
</tr>
<tr>
<td>CCD Size</td>
<td>1/4 inch</td>
</tr>
<tr>
<td>net weight</td>
<td>17g</td>
</tr>
<tr>
<td>Gross weight</td>
<td>41g</td>
</tr>
<tr>
<td>Product Size</td>
<td>24*48*19mm</td>
</tr>
<tr>
<td>Package Size</td>
<td>75*45*30mm</td>
</tr>
</table>
## EasyLoader
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.webp" width="100px" style="margin-top:20px">
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/Unit/M5-Camera-F/wifi_ap/EasyLoader_M5-Camera-F_wifi_ap.exe"><button type="button" class="btn btn-primary">click to download EasyLoader</button></a>
>1.EasyLoader is a simple and fast program burner. Every product page in EasyLoader provides a product-related case program. It can be burned to the master through simple steps, and a series of function verification can be performed. .
>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 start burning. (**For M5StickC burning, please Set the baud rate to 750000 or 115200**)
?>3. Currently EasyLoader is only suitable for Windows operating system, compatible with M5 system adopts ESP32 as the control core host. Before installing for M5Core, you need to install CP210X driver (you do not need to install with M5StickC as controller)[Click here to view the driver installation tutorial](en/related_documents/M5Burner#install-usb-driver)
## PinMap
**Camera Interface PinMap**
| *Interface* | *Camera Pin*| *M5CameraF* |
| :------------------- | :--------:| :------: |
| SCCB Clock | SIOC |IO23 |
| SCCB Data | SIOD |**IO22** |
| System Clock | XCLK |IO27 |
| Vertical Sync | VSYNC |**IO25** |
| Horizontal Reference | HREF |IO26 |
| Pixel Clock | PCLK |IO21 |
| Pixel Data Bit 0 | D2 |IO32 |
| Pixel Data Bit 1 | D3 |IO35 |
| Pixel Data Bit 2 | D4 |IO34 |
| Pixel Data Bit 3 | D5 |IO5 |
| Pixel Data Bit 4 | D6 |IO39 |
| Pixel Data Bit 5 | D7 |IO18 |
| Pixel Data Bit 6 | D8 |IO36 |
| Pixel Data Bit 7 | D9 |IO19 |
| Camera Reset | RESET |IO15 |
| Camera Power Down | PWDN | *see Note 1* |
| Power Supply 3.3V | 3V3 | 3V3 |
| Ground | GND | GND |
**GROVE Interface**
| *Grove* | *M5CameraF* |
| :-----------: | :------: |
| SCL | **IO13** |
| SDA | **IO4** |
| 5V | 5V |
| GND | GND |
**LED Interface**
| *LED* | *M5CameraF* |
| :-----------: | :------: |
| LED_Pin | IO14 |
**NOTE:**
1. **Camera Power Down** pin does not need to be connected to ESP32 GPIO. Instead it may be pulled down to ground with 10 kOhm resistor.
2. We have several patterns of camera board, the following figures shows the main differece
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_table/camera_compare.webp">
## Related Link
- **Datasheet** - [ESP32](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/core/esp32_datasheet_en.pdf) - [OV2640](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/OV2640DS_en.pdf)
## Example
### Firmware
- **[M5Camera Firmware](https://github.com/m5stack/M5Stack-Camera/tree/master/wifi/wifi_ap/firmware/M5CameraF)**
### Code
- **[Serial communication-M5CameraF](https://github.com/m5stack/M5Stack-Camera/tree/master/uart/firmware/M5CameraF)**
- **[Serial communication-M5Core](https://github.com/m5stack/M5Stack-Camera/tree/master/uart/arduino)**The serial communication routine is the communication between the camera and the M5Core.
- **[QRcode](https://github.com/m5stack/M5Stack-Camera/tree/master/qr/firmware/M5CameraF)**
### Source Code
- **[M5Camera](https://github.com/m5stack/M5Stack-Camera)**
## Schematic
### Power circuit
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_schematic/unit/m5camera_sch_01.webp">
### Chip peripheral circuit
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_schematic/unit/m5camera_sch_02.webp">
### USB to serial port part of the circuit
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_schematic/unit/m5camera_sch_03.webp">
- **[Color recognition](https://github.com/m5stack/Applications-cam)**
- **[Face recognition](https://github.com/m5stack/esp-who)** -->
<script>
var purchase_link = 'https://m5stack.com/collections/m5-unit/products/fish-eye-camera-module-ov2640';
var quickstart_link = 'https://docs.m5stack.com/#/en/quick_start/m5camera/m5camera_quick_start';
anchor_search(purchase_link,quickstart_link);
scrollFunc();
</script>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

+2
View File
@@ -84,6 +84,7 @@
{a:"/#/en/base/base26", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/base/base_base26_01.webp", p:"BASE26", sku:"K026" ,kw:"PROTOTYPE"},
{a:"/#/en/accessory/battery_base", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/accessory/battery_base_01.webp", p:"M5CameraBattery", sku:"A068" ,kw:"BATTERY"},
{a:"/#/en/base/basex", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/base/base_basex_01.webp", p:"BaseX", sku:"K037" ,kw:"LEGO EV3 MOTOR"},
{a:"/#/en/base/w5500PoE", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/base/w5500PoE_01.webp", p:"PoE", sku:"K012-C" ,kw:"W5500 INTERNET RS485 PoE"},
];
const unit_list = [
@@ -93,6 +94,7 @@
{a:"#/en/unit/m5camera_f", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_m5camera_f_01.webp", p:"M5CameraF", sku:"U037", qs:"#en/quick_start/m5camera/m5camera_quick_start" ,kw:"ESP32 CAMERA"},
{a:"/#/en/unit/m5camera_x", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_m5camera_x_01.webp", p:"M5CameraX", sku:"U038", qs:"#en/quick_start/m5camera/m5camera_quick_start" ,kw:"ESP32 CAMERA"},
{a:"/#/en/unit/unitv", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit-v-01.webp", p:"UNIT-V", sku:"U078", qs:"#en/quick_start/unitv/unitv_quick_start" ,kw:"K210 CAMERA"},
{a:"/#/en/unit/m5camera_f_new", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_m5camera_f_new_01.webp", p:"M5CameraF New", sku:"U037", qs:"#en/quick_start/m5camera/m5camera_quick_start" ,kw:"ESP32 CAMERA"},
//Sensor class
{a:"/#/en/unit/earth", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_earth_01.webp", p:"EARTH", sku:"U019" ,kw:"SENSOR"},
{a:"/#/en/unit/env", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_env_01.webp", p:"ENV", sku:"U001" ,kw:"DHT12 BMP280"},
+2
View File
@@ -86,6 +86,7 @@
{a:"/#/zh_CN/base/base26", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/base/base_base26_01.webp", p:"BASE26", sku:"K026" ,kw:"PROTOTYPE"},
{a:"/#/zh_CN/accessory/battery_base", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/accessory/battery_base_01.webp", p:"M5CameraBattery", sku:"A068" ,kw:"BATTERY"},
{a:"/#/zh_CN/base/basex", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/base/base_basex_01.webp", p:"BaseX", sku:"K037" ,kw:"LEGO EV3 MOTOR"},
{a:"/#/zh_CN/base/w5500PoE", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/base/w5500PoE_01.webp", p:"PoE", sku:"K012-C" ,kw:"W5500 LAN PoE INTERNET RS485"},
];
const unit_list = [
@@ -95,6 +96,7 @@
{a:"#/zh_CN/unit/m5camera_f", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_m5camera_f_01.webp", p:"M5CameraF", sku:"U037", qs:"#zh_CN/quick_start/m5camera/m5camera_quick_start" ,kw:"ESP32 CAMERA"},
{a:"/#/zh_CN/unit/m5camera_x", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_m5camera_x_01.webp", p:"M5CameraX", sku:"U038", qs:"#zh_CN/quick_start/m5camera/m5camera_quick_start" ,kw:"ESP32 CAMERA"},
{a:"/#/zh_CN/unit/unitv", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit-v-01.webp", p:"UNIT-V", sku:"U078", qs:"#zh_CN/quick_start/unitv/unitv_quick_start" ,kw:"K210 CAMERA"},
{a:"/#/zh_CN/unit/m5camera_f_new", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_m5camera_f_new_01.webp", p:"M5CameraF New", sku:"U037", qs:"#zh_CN/quick_start/m5camera/m5camera_quick_start" ,kw:"ESP32 CAMERA"},
//Sensor class
{a:"/#/zh_CN/unit/earth", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_earth_01.webp", p:"EARTH", sku:"U019" ,kw:"SENSOR"},
{a:"/#/zh_CN/unit/env", img:"https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_homepage/unit/unit_env_01.webp", p:"ENV", sku:"U001" ,kw:"DHT12 BMP280"},
+127
View File
@@ -0,0 +1,127 @@
# IMU
*IMU根据主机配置不同自动调用不同的IMU型号*
## Init()
**函数原型:**
<mark>int Init(void);</mark>
**功能:初始化 IMU 芯片。**
**例程:**
```arduino
#include <M5StickC.h>
void setup() {
M5.begin();
int x = M5.IMU.Init(); //return 0 is ok, return -1 is unknow
Serial.println(x);
}
void loop() {}
```
## getGyroData()
**函数原型:**
<mark>void getGyroData(float *gx, float *gy, float *gz);</mark>
**功能:获取 IMU 芯片的三轴陀螺仪数据。**
**例程:**
```arduino
#include <M5StickC.h>
float gyroX, gyroY, gyroZ;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getGyroData(&gyroX, &gyroY, &gyroZ);
M5.Lcd.setCursor(0, 30);
M5.Lcd.printf("X:%7.2f\nY:%7.2f\nZ:%7.2f ", gyroX, gyroY, gyroZ);
delay(500);
}
```
## getAccelData()
**函数原型:**
<mark>void getAccelData(float *ax, float *ay, float *az);</mark>
**功能:获取 IMU 芯片的三轴加速度计数据。**
**例程:**
```arduino
#include <M5StickC.h>
float accX, accY, accZ;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getAccelData(&accX, &accY, &accZ);
M5.Lcd.setCursor(0, 45);
M5.Lcd.printf("X:%5.2f\nY:%5.2f\nZ:%5.2f ", accX, accY, accZ);
delay(500);
}
```
## getAhrsData()
**函数原型:**
<mark>void getAccelData(float *pitch, float *roll, float *yaw);</mark>
**功能:获取 IMU 芯片的姿态。**
**例程:**
```arduino
#include <M5StickC.h>
float pitch, roll, yaw;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getAhrsData(&pitch, &roll, &yaw);
M5.Lcd.setCursor(0, 45);
M5.Lcd.printf("X:%5.2f\nY:%5.2f\nZ:%5.2f ", pitch, roll, yaw);
delay(500);
}
```
## getTempData()
**函数原型:**
<mark>void getTempData(float *t);</mark>
**功能:获取 IMU 芯片的温度。**
**例程:**
```arduino
#include <M5StickC.h>
float temp;
void setup() {
M5.begin();
M5.IMU.Init();
}
void loop() {
M5.IMU.getTempData(&temp);
M5.Lcd.setCursor(0, 45);
M5.Lcd.printf("Temperature : %.2f C", temp);
delay(500);
}
```
+48
View File
@@ -0,0 +1,48 @@
# PWM
*PWM用于产生模拟信号驱动舵机或蜂鸣器*
## ledcSetup()
**函数原型:**
<mark>void ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits);</mark>
**功能:设置PWM通道,频率和分辨率。**
## ledcAttachPin()
**函数原型:**
<mark>void ledcAttachPin(uint8_t pin, uint8_t channel);</mark>
**功能:将 LEDC 通道绑定到指定 IO 口上以实现输出**
## ledWrite()
**函数原型:**
<mark>void ledcWrite(uint8_t channel, uint32_t duty);</mark>
**功能:向channel通道写入duty%占空比。**
**例程:**
```arduino
#include <M5StickC.h>
int freq = 1800;
int channel = 0;
int resolution_bits = 8;
int buzzer = 2;
void setup() {
M5.begin();
ledcSetup(channel, freq, resolution_bits);
ledcAttachPin(buzzer, channel);
}
void loop() {
ledcWrite(channel, 128);
delay(1000);
ledcWrite(channel, 0);
delay(1000);
}
```
+2 -63
View File
@@ -11,71 +11,10 @@
|**[I2C](zh_CN/api/commutil)** |**[EEPROM](zh_CN/api/eeprom)**|
|**[WIFI](zh_CN/api/wifi)**|
<!-- <table>
<tr>
<th align="center"><a href="#/zh_CN/api/system">System</a></th>
<th align="center"><a href="#/zh_CN/api/speaker">喇叭</a></th>
<th align="center"><a href="#/zh_CN/api/speaker">LCD 屏幕</a></th>
<th align="center"><a href="#/zh_CN/api/speaker">按键</a></th>
</tr>
<tr>
<th align="center"><a href="#/zh_CN/api/system">Power</a></th>
<th align="center"><a href="#/zh_CN/api/speaker">TF 卡</a></th>
<th align="center"><a href="#/zh_CN/api/speaker">姿态传感器 (MPU9250)</a></th>
<th align="center"><a href="#/zh_CN/api/speaker"> </a></th>
</tr>
</table> -->
## M5StickC
<!-- |||
|:---:|:---:|
|**[System](zh_CN/api/system)** | **[喇叭](zh_CN/api/speaker)** |
|**[LCD 屏](zh_CN/api/lcd)** | **[按键](zh_CN/api/button)** |
|**[MPU9250](zh_CN/api/mpu9250)** | **[TF 卡](zh_CN/api/tf)** |
|**[Power](zh_CN/api/power)** | -->
|||
|:---:|:---:|
|**[System](zh_CN/api/system_m5stickc)** | **[AXP192](zh_CN/api/axp192_m5stickc)** |
|**[TFT 屏](zh_CN/api/lcd_m5stickc)** | **[SH200Q](zh_CN/api/sh200q_m5stickc)** |
|**[RTC](zh_CN/api/rtc)**|
<!-- |**[麦克风](zh_CN/api/spm1423_m5stickc)** | **[LED](zh_CN/api/led_m5stickc)** |
|**[按键](zh_CN/api/buttom_m5stickc)** | **[红外发射](zh_CN/api/led_m5stickc)** | -->
<!-- <div class="table-wrapper">
<table class="fl-table">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
<th>Header 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Content</td>
<td>Content</td>
<td>Content</td>
</tr>
<tr>
<td>2</td>
<td>Content</td>
<td>Content</td>
<td>Content</td>
</tr>
<tr>
<td>3</td>
<td>Content</td>
<td>Content</td>
<td>Content</td>
</tr>
<tbody>
</table>
</div> -->
|**[TFT 屏](zh_CN/api/lcd_m5stickc)** | **[IMU](zh_CN/api/imu)** |
|**[RTC](zh_CN/api/rtc)** | **[PWM](en/api/pwm)** |

Some files were not shown because too many files have changed in this diff Show More