diff --git a/docs/assets/img/product_pics/module/module_gps_01.png b/docs/assets/img/product_pics/module/module_gps_01.png index 01e4a8fc..99ca1a0d 100644 Binary files a/docs/assets/img/product_pics/module/module_gps_01.png and b/docs/assets/img/product_pics/module/module_gps_01.png differ diff --git a/docs/en/api.md b/docs/en/api.md index 2ddfa866..4ce01d84 100644 --- a/docs/en/api.md +++ b/docs/en/api.md @@ -1,8 +1,8 @@ # API Reference -| MicroPython | Arduino | -|:------------|:--------| -|[LCD](en/api_reference/micropython/api_lcd) | / | +||| +|:---:|:---:| +|**[LCD](en/api/lcd)** | **[Speaker](en/api/speaker)** | @@ -40,6 +39,8 @@ [![battery_01.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_battery_01.png)](en/module/battery)         [![proto_01.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_proto_01.png)](en/module/proto)         [![plus_1.png](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_plus_01.png)](en/module/plus) + + **Drive Modules** diff --git a/docs/ja/api.md b/docs/ja/api.md index 31298055..c9c3e354 100644 --- a/docs/ja/api.md +++ b/docs/ja/api.md @@ -1,7 +1,5 @@ # API リファレンス - - -| MicroPython | Arduino | -|:------------|:--------| -|[LCD](ja/api_reference/micropython/api_lcd) | [LCD](ja/api_reference/arduino/api_lcd) | \ No newline at end of file +||| +|:---:|:---:| +|**[LCD](ja/api/lcd)** | **[Speaker](ja/api/speaker)** | diff --git a/docs/zh_CN/README.md b/docs/zh_CN/README.md index 0802b3ac..48ac88c1 100644 --- a/docs/zh_CN/README.md +++ b/docs/zh_CN/README.md @@ -36,11 +36,11 @@ M5GO物联网开发套件              FACES   GPS定位导航模块                Lora节点模块 -[![module_commu.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_commu_01.png)](zh_CN/module/commu)         [![module_usb.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_usb_01.png)](zh_CN/module/usb) +[![module_commu.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_commu_01.png)](zh_CN/module/commu) **拓展模块** -[![battery_01.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_battery_01.png)](zh_CN/module/battery)         [![proto_01.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_proto_01.png)](zh_CN/module/proto)         [![plus_1.png](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_plus_01.png)](zh_CN/module/plus) +[![battery_01.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_battery_01.png)](zh_CN/module/battery)         [![proto_01.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_proto_01.png)](zh_CN/module/proto)         [![plus_1.png](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_plus_01.png)](zh_CN/module/plus)         [![module_usb.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_usb_01.png)](zh_CN/module/usb) **驱动模块** diff --git a/docs/zh_CN/api.md b/docs/zh_CN/api.md index 1cd86b42..5214aa82 100644 --- a/docs/zh_CN/api.md +++ b/docs/zh_CN/api.md @@ -1,8 +1,8 @@ -# API Reference +# API参考 -| MicroPython | Arduino | -|:------------|:--------| -|[LCD](zh_CN/api_reference/micropython/api_lcd) | [LCD](zh_CN/api_reference/arduino/api_lcd) | +||| +|:---:|:---:| +|**[LCD](zh_CN/api/lcd)** | **[Speaker](zh_CN/api/speaker)** | diff --git a/docs/zh_CN/api/lcd.md b/docs/zh_CN/api/lcd.md index cccc0343..a95aad99 100644 --- a/docs/zh_CN/api/lcd.md +++ b/docs/zh_CN/api/lcd.md @@ -42,6 +42,9 @@ M5.Lcd.setTextColor(RED); ``` ```python # MicroPython +from m5stack import * +from m5ui import * + lcd.setTextColor(lcd.RED) lcd.setTextColor(lcd.ORANGE, lcd.DARKCYAN) ``` diff --git a/docs/zh_CN/base/node_base.md b/docs/zh_CN/base/node_base.md index 4483584a..f4601470 100644 --- a/docs/zh_CN/base/node_base.md +++ b/docs/zh_CN/base/node_base.md @@ -4,7 +4,9 @@ *** -:memo:**[描述](#描述)**      :octocat:**[例程](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**      :electric_plug:**[原理图](https://github.com/m5stack/Bases-Node/tree/master/schematic)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)** +:memo:**[描述](#描述)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)** + + ## 描述 diff --git a/docs/zh_CN/base/plc_base.md b/docs/zh_CN/base/plc_base.md index acc42030..790be11d 100644 --- a/docs/zh_CN/base/plc_base.md +++ b/docs/zh_CN/base/plc_base.md @@ -1,3 +1,48 @@ # PLC-Base -## (coming soon...) \ No newline at end of file + + +*** + +:memo:**[Description](#Description)**      :octocat:**[Example](#Example)**      :electric_plug:**[Schematic](#Schematic)**      🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-PLC-Proto-Industrial-Board-Module-Contains-RS485-ACS712-5B-Programmable-Logic-Controller-Relay-with-Magnet/3226069_32874916056.html?spm=2114.12010615.8148356.2.4c5b68a1WZ8sjd)** + +## Description + +The M5Stack PLC Module is a prototye industrial board, including RS484 +adapter and electricity meter module. + +With DC9~24V power input, PLC-Proto motherboard reserved 6Pin or 4Pin +relay output, digital input, communication interface etc. + +## Feature + +- Free DIY +- Programmable Logic Controller +- Individual package weight: 0.1kg (0.22lb.) +- Package size: 5cm \* 5cm \* 5cm (1.97in \* 1.97in \* 1.97in) + +## Include + +- 1x PLC-Proto Broad +- 1x RS485 module +- 1x PLC Plastic Enclosure +- 1x Slide Guide +- 1x Magnet +- 1x 6 Pin 3.96 Pitch Terminal +- 1x 4 Pin 3.96 Pitch Terminal +- 3x Hex Key +- 7x Electrical Terminal +- 1x Sticker + +## Applications + +- Programmable Logic Controller +- Programmable Motion Controller +- Digital Operation Processor +- Strong Electric Controller + +## Related Link + +- **[Offical Video](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** + +- **[Forum](http://forum.m5stack.com/)** diff --git a/docs/zh_CN/module/battery.md b/docs/zh_CN/module/battery.md index 703c4b01..bb4eb7b4 100644 --- a/docs/zh_CN/module/battery.md +++ b/docs/zh_CN/module/battery.md @@ -1,4 +1,4 @@ -# 电池模块 +# BATTERY - 电池模块 diff --git a/docs/zh_CN/module/commu.md b/docs/zh_CN/module/commu.md index bb6dbf55..2b46ef51 100644 --- a/docs/zh_CN/module/commu.md +++ b/docs/zh_CN/module/commu.md @@ -1,4 +1,4 @@ -# COMMU +# COMMU - 通信模块 @@ -16,10 +16,7 @@ COMMU模块中的TTL接口,实际上是串口接口,默认连接的是串口 ## 特性 -- 2x I2C 接口 -- 1x CAN 接口 -- 1x RS485 接口 -- 1x TTL 接口 +- 拓展2个 I2C 接口, 1个 CAN 接口, 1个 RS485 接口, 1个 TTL 接口 ## 包含 diff --git a/docs/zh_CN/module/gps.md b/docs/zh_CN/module/gps.md index 333f94a1..40a1ea96 100644 --- a/docs/zh_CN/module/gps.md +++ b/docs/zh_CN/module/gps.md @@ -1,4 +1,4 @@ -# GPS模块 +# GPS - 定位导航模块 diff --git a/docs/zh_CN/module/lan.md b/docs/zh_CN/module/lan.md deleted file mode 100644 index aaceaf7d..00000000 --- a/docs/zh_CN/module/lan.md +++ /dev/null @@ -1,44 +0,0 @@ -# M5Stack LAN Module - - - -*** - -:memo:**[Description](#Description)**      :octocat:**[Example](#Example)**      :electric_plug:**[Schematic](#Schematic)**      🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-New-Arrival-LAN-Module-with-W5500-Chip-LanProto-Ethernet-convert-Network-Module-Microcontroller-for-Arduino/3226069_32904089417.html)** - -## Description - -The M5Stack LAN Module is a ethernet module which with a I2C Grove port and 6 pins user ports. - -When the speed of our wireless network is so slow that M5Stack Core can not normally connect to the wireless network. -So we need a ethernet port board which is connected with M5Stack Core. This **LAN module** is that one who solves the awkward problem. - - -## Feature - -- W5500 - High-performance ethernet chip -- Less code and Hand-in-hand program experience - -## Include - -- 1x M5Stack LAN Module(including USER-DEFINE 6 PIN and 1 Grove port) -- 1x DIN-RAIL -- 1x STICKER - -## Applications - -- A mini portable Web server - + TCP/UDP Server - + HTTP Server -- A mini portable Web Clinet - + TCP/UDP Clinet - + HTTP Clinet -- SMTP/NTP Server - -## Related Link - -- **[Offical Video](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** - -- **[Forum](http://forum.m5stack.com/)** - -- [LAN Info](https://www.u-blox.com/zh/product/neo-m8-series) (LAN) diff --git a/docs/zh_CN/module/lego_plus.md b/docs/zh_CN/module/lego_plus.md index af1455bf..4a10b256 100644 --- a/docs/zh_CN/module/lego_plus.md +++ b/docs/zh_CN/module/lego_plus.md @@ -1,10 +1,12 @@ -# LEGO+模块 +# LEGO+ - 乐高电机驱动模块 *** -:memo:**[描述](#描述)**      :octocat:**[例程](https://github.com/m5stack/M5Stack/tree/master/examples/Modules/GPS)**      🛒**[购买链接](https://www.aliexpress.com/store/product/M5Stack-MEGA328-4-DC-10-DC-I2C/3226069_32961587834.html)** +:memo:**[描述](#描述)**      :octocat:**[例程](https://github.com/m5stack/M5Stack/tree/master/examples/Modules/GPS)**      🛒**[购买链接](https://www.aliexpress.com/store/product/M5Stack-MEGA328-4-DC-10-DC-I2C/3226069_32961587834.html)** + + ## 描述 @@ -27,11 +29,11 @@ - **[官方论坛](http://forum.m5stack.com/)** - +- **[模块内MEGA328固件](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LEGO_PLUS/firmware_328p)** ## 例程 -### 1. Arduino IDE + diff --git a/docs/zh_CN/module/lora.md b/docs/zh_CN/module/lora.md index efd9e0b1..89337b16 100644 --- a/docs/zh_CN/module/lora.md +++ b/docs/zh_CN/module/lora.md @@ -1,4 +1,4 @@ -# LORA模块 +# LORA - LoRa节点模块(433MHz) diff --git a/docs/zh_CN/module/lorawan.md b/docs/zh_CN/module/lorawan.md index c4c84936..93ac536a 100644 --- a/docs/zh_CN/module/lorawan.md +++ b/docs/zh_CN/module/lorawan.md @@ -1,4 +1,4 @@ -# LoRaWAN +# LoRaWAN - LoRa节点模块(433/470MHz和868/915MHz) diff --git a/docs/zh_CN/module/plc.md b/docs/zh_CN/module/plc.md deleted file mode 100644 index 92fbea37..00000000 --- a/docs/zh_CN/module/plc.md +++ /dev/null @@ -1,48 +0,0 @@ -# M5Stack PLC Module - - - -*** - -:memo:**[Description](#Description)**      :octocat:**[Example](#Example)**      :electric_plug:**[Schematic](#Schematic)**      🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-PLC-Proto-Industrial-Board-Module-Contains-RS485-ACS712-5B-Programmable-Logic-Controller-Relay-with-Magnet/3226069_32874916056.html?spm=2114.12010615.8148356.2.4c5b68a1WZ8sjd)** - -## Description - -The M5Stack PLC Module is a prototye industrial board, including RS484 -adapter and electricity meter module. - -With DC9~24V power input, PLC-Proto motherboard reserved 6Pin or 4Pin -relay output, digital input, communication interface etc. - -## Feature - -- Free DIY -- Programmable Logic Controller -- Individual package weight: 0.1kg (0.22lb.) -- Package size: 5cm \* 5cm \* 5cm (1.97in \* 1.97in \* 1.97in) - -## Include - -- 1x PLC-Proto Broad -- 1x RS485 module -- 1x PLC Plastic Enclosure -- 1x Slide Guide -- 1x Magnet -- 1x 6 Pin 3.96 Pitch Terminal -- 1x 4 Pin 3.96 Pitch Terminal -- 3x Hex Key -- 7x Electrical Terminal -- 1x Sticker - -## Applications - -- Programmable Logic Controller -- Programmable Motion Controller -- Digital Operation Processor -- Strong Electric Controller - -## Related Link - -- **[Offical Video](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** - -- **[Forum](http://forum.m5stack.com/)** diff --git a/docs/zh_CN/module/plus.md b/docs/zh_CN/module/plus.md index 4b959a19..a3bb045e 100644 --- a/docs/zh_CN/module/plus.md +++ b/docs/zh_CN/module/plus.md @@ -46,33 +46,27 @@ #define IrPin 13 #define PLUS_ADDR 0x62 -void setup() { - M5.begin(true, false, false); - Wire.begin(); - ledcSetup(1, 38000, 10); ledcAttachPin(IrPin, 1);// IR Pin setting -} +// declaration +int32_t number = 0; +uint8_t press = 0; -void plus_encode() { - Wire.requestFrom(PLUS_ADDR, 2); - while(Wire.available()) { - int8_t encode = Wire.read(); - uint8_t press_n = Wire.read(); - number += encode; - if(press_n == 0xff) { - press = 0;//encoder was pressed - } - else { - press = 1; - } +// initialization +M5.begin(true, false, false); +Wire.begin(); +ledcSetup(1, 38000, 10); ledcAttachPin(IrPin, 1);// IR Pin setting + +// read data +Wire.requestFrom(PLUS_ADDR, 2); +while(Wire.available()) { + int8_t encode = Wire.read(); + uint8_t press_n = Wire.read(); + number += encode; + if(press_n == 0xff) { + press = 0;//encoder was pressed + } + else { + press = 1;//encoder was releaed } -} - -void loop() { - char data[20]; - - plus_encode(); - ledcWrite(1, ledcRead(1) ? 0 : 512); - sprintf(data, "%d %d ", number, press); } ``` diff --git a/docs/zh_CN/module/proto.md b/docs/zh_CN/module/proto.md index 8366a012..b94bc3d3 100644 --- a/docs/zh_CN/module/proto.md +++ b/docs/zh_CN/module/proto.md @@ -1,4 +1,4 @@ -# PROTO模块 +# PROTO - 万能板模块 diff --git a/docs/zh_CN/module/servo.md b/docs/zh_CN/module/servo.md index 39952395..abf06ab9 100644 --- a/docs/zh_CN/module/servo.md +++ b/docs/zh_CN/module/servo.md @@ -1,14 +1,16 @@ -# SERVO +# SERVO - 舵机驱动模块 *** -:memo:**[描述](#描述)**      :octocat:**[例程](#例程)**      :electric_plug:**[原理图](#原理图)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.6c6f425e2rHsr9&id=581189197514)** +:memo:**[描述](#描述)**      :octocat:**[例程](#例程)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.6c6f425e2rHsr9&id=581189197514)** + + ## 描述 -Servo是一个普通舵机(比如常见的9g舵机)驱动模块,它理论上可以同时驱动12路舵机。可是实际测试中,因为同时带动12路舵机时,电流很大,所以这个模块暂时能同时驱动9路舵机。过段时间,我们会推出改进升级版本,敬请期待。 +Servo是一个普通舵机(比如常见的9g舵机)驱动模块,它理论上可以同时驱动12路舵机。可是实际测试中,因为同时带动12路舵机时,电流很大,所以这个模块暂时能同时驱动9路舵机。过段时间,我们会推出改进升级版本,敬请期待。 Servo模块使用起来非常简单,因为内置了MEGA328芯片来管理多路舵机,所以使用的时候,只需要M5Core与Servo模块堆叠之后,通过GRVOE接口(I2C)通信(I2C地址是0x53)。编程时,在Arduino IDE环境下,也只需2-3行即可驱动。而且还支持UiFlow编程,只需要拖拽代码块即可使用。 @@ -39,7 +41,7 @@ Servo模块使用起来非常简单,因为内置了MEGA328芯片来管理多 ### 1. Arduino IDE -*以下仅为用法示意,并不完整。如果需要完整例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/SERVO/Arduino)。* +*例程下载请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/SERVO/Arduino)。* ```arduino #include @@ -49,10 +51,14 @@ Servo模块使用起来非常简单,因为内置了MEGA328芯片来管理多 #define SERVO_ADDR 0x53 void setup() { M5.begin(true, false, true); + M5.Lcd.setTextFont(4); + M5.Lcd.setCursor(70, 100); + M5.Lcd.print("Servo Example"); + Wire.begin(21, 22, 100000); } -// addr 0x01 mean control the number 1 servo by us +// addr 0x01 means "control the number 1 servo by us" void Servo_write_us(uint8_t number, uint16_t us) { Wire.beginTransmission(SERVO_ADDR); Wire.write(0x00 | number); @@ -61,6 +67,14 @@ void Servo_write_us(uint8_t number, uint16_t us) { Wire.endTransmission(); } +// addr 0x11 means "control the number 1 servo by angle" +void Servo_write_angle(uint8_t number, uint8_t angle) { + Wire.beginTransmission(SERVO_ADDR); + Wire.write(0x10 | number); + Wire.write(angle); + Wire.endTransmission(); +} + void loop() { for(uint8_t i = 0; i < 12; i++){ Servo_write_us(i, 700); diff --git a/docs/zh_CN/module/sim800.md b/docs/zh_CN/module/sim800.md index f5740993..b5a4f80c 100644 --- a/docs/zh_CN/module/sim800.md +++ b/docs/zh_CN/module/sim800.md @@ -1,4 +1,4 @@ -# M5Stack SIM800L Module +# SIM800L - GSM/GPRS通信模块 diff --git a/docs/zh_CN/module/stepmotor.md b/docs/zh_CN/module/stepmotor.md index 8807bf3d..f5114ba5 100644 --- a/docs/zh_CN/module/stepmotor.md +++ b/docs/zh_CN/module/stepmotor.md @@ -1,4 +1,4 @@ -# Step Motor Module +# STEPMOTOR - 步进电机驱动模块 @@ -6,7 +6,9 @@ *** -:memo:**[描述](#描述)**      :octocat:**[例程](#例程)**      :electric_plug:**[原理图](#原理图)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.61.501375f4xEgd84&id=572288296141)** +:memo:**[描述](#描述)**      :octocat:**[例程](#例程)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.61.501375f4xEgd84&id=572288296141)** + + ## 描述 @@ -92,10 +94,11 @@ void loop() { #define STEPMOTOR_I2C_ADDR 0x70 +// initialization M5.begin(); Wire.begin(); -// Protocol: +// Controlling Protocol: // G XYZ F SendCommand(STEPMOTOR_I2C_ADDR, "G1 X20Y20Z20 F500"); SendCommand(STEPMOTOR_I2C_ADDR, "G1 X0Y0Z0 F400"); diff --git a/docs/zh_CN/module/usb.md b/docs/zh_CN/module/usb.md index 6d06461b..61f5ae13 100644 --- a/docs/zh_CN/module/usb.md +++ b/docs/zh_CN/module/usb.md @@ -1,4 +1,4 @@ -# USB +# USB - USB外设驱动模块 diff --git a/docs/zh_CN/unit/tof.md b/docs/zh_CN/unit/tof.md index b99e3d86..efa082c6 100644 --- a/docs/zh_CN/unit/tof.md +++ b/docs/zh_CN/unit/tof.md @@ -1,4 +1,4 @@ -# TOF - 红外激光测距Unit +# TOF - 激光测距Unit