This commit is contained in:
LiHuashen
2018-12-28 19:53:59 +08:00
parent 92a03509fd
commit f7c839b809
24 changed files with 126 additions and 159 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

After

Width:  |  Height:  |  Size: 138 KiB

+3 -3
View File
@@ -1,8 +1,8 @@
# API Reference
| MicroPython | Arduino |
|:------------|:--------|
|[LCD](en/api_reference/micropython/api_lcd) | / |
|||
|:---:|:---:|
|**[LCD](en/api/lcd)** | **[Speaker](en/api/speaker)** |
<!-- ## [LCD](en/api_reference/micropython/api_lcd) -->
<!-- ## [Peripherals](en/api_reference/peripherals/api_gpio)
+2 -1
View File
@@ -30,7 +30,6 @@
[![module_commu.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_commu_01.png)](en/module/commu)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!-- [![module_usb.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_usb_01.png)](en/module/usb) -->
<!-- [![usb_01.jpg](https://i.loli.net/2018/12/13/5c1216928954a.jpg)](en/module/usb) -->
@@ -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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)
<!-- [![module_usb.jpg](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/assets/img/product_pics/homepage_picture/module/module_usb_01.png)](en/module/usb) -->
<!-- |[BATTERY]()|[PROTO]()| -->
**Drive Modules**
+3 -5
View File
@@ -1,7 +1,5 @@
# API リファレンス
| MicroPython | Arduino |
|:------------|:--------|
|[LCD](ja/api_reference/micropython/api_lcd) | [LCD](ja/api_reference/arduino/api_lcd) |
|||
|:---:|:---:|
|**[LCD](ja/api/lcd)** | **[Speaker](ja/api/speaker)** |
+2 -2
View File
@@ -36,11 +36,11 @@ M5GO物联网开发套件&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FACES
&nbsp; GPS定位导航模块&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![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)
**驱动模块**
+4 -4
View File
@@ -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)** |
<!-- |[BUTTON](zh_CN/api_reference/micropython/api_lcd) | [BUTTON](zh_CN/api_reference/arduino/api_lcd) |
|[SPEAKER](zh_CN/api_reference/micropython/api_lcd) | [SPEAKER](zh_CN/api_reference/arduino/api_lcd) | -->
+3
View File
@@ -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)
```
+3 -1
View File
@@ -4,7 +4,9 @@
***
:memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[原理图](https://github.com/m5stack/Bases-Node/tree/master/schematic)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)**
:memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)**
<!-- :memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[原理图](https://github.com/m5stack/Bases-Node/tree/master/schematic)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)** -->
## 描述
+46 -1
View File
@@ -1,3 +1,48 @@
# PLC-Base
## (coming soon...)
<img src="assets/img/product_pics/module/module_plc_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_plc_02.png" width="30%" height="30%">
***
:memo:**[Description](#Description)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[Example](#Example)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[Schematic](#Schematic)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[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/)**
+1 -1
View File
@@ -1,4 +1,4 @@
# 电池模块
# BATTERY - 电池模块
<img src="assets/img/product_pics/module/module_battery_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_battery_02.png" width="30%" height="30%">
+2 -5
View File
@@ -1,4 +1,4 @@
# COMMU
# COMMU - 通信模块
<img src="assets/img/product_pics/module/module_commu_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_commu_02.png" width="30%" height="30%">
@@ -16,10 +16,7 @@ COMMU模块中的TTL接口,实际上是串口接口,默认连接的是串口
## 特性
- 2x I2C 接口
- 1x CAN 接口
- 1x RS485 接口
- 1x TTL 接口
- 拓展2个 I2C 接口, 1个 CAN 接口, 1个 RS485 接口, 1个 TTL 接口
## 包含
+1 -1
View File
@@ -1,4 +1,4 @@
# GPS模块
# GPS - 定位导航模块
<img src="assets/img/product_pics/module/module_gps_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_gps_02.png" width="30%" height="30%">
-44
View File
@@ -1,44 +0,0 @@
# M5Stack LAN Module
<img src="assets/img/product_pics/module/module_lan_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lan_02.png" width="30%" height="30%">
***
:memo:**[Description](#Description)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[Example](#Example)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[Schematic](#Schematic)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[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)
+6 -4
View File
@@ -1,10 +1,12 @@
# LEGO+模块
# LEGO+ - 乐高电机驱动模块
<img src="assets/img/product_pics/module/module_lego_plus_01.png" width="30%" height="30%"><!-- <img src="assets/img/product_pics/module/module_lego_plus_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lego_plus_03.png" width="30%" height="30%"> -->
***
:memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](https://github.com/m5stack/M5Stack/tree/master/examples/Modules/GPS)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!-- :electric_plug:**[原理图](https://github.com/m5stack/M5-Schematic/blob/master/Modules/GPS.pdf)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->🛒**[购买链接](https://www.aliexpress.com/store/product/M5Stack-MEGA328-4-DC-10-DC-I2C/3226069_32961587834.html)**
:memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](https://github.com/m5stack/M5Stack/tree/master/examples/Modules/GPS)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://www.aliexpress.com/store/product/M5Stack-MEGA328-4-DC-10-DC-I2C/3226069_32961587834.html)**
<!-- :memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](https://github.com/m5stack/M5Stack/tree/master/examples/Modules/GPS)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[原理图](https://github.com/m5stack/M5-Schematic/blob/master/Modules/GPS.pdf)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](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固件]()** -->
- **[模块内MEGA328固件](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LEGO_PLUS/firmware_328p)**
## 例程
### 1. Arduino IDE
<!-- ### 1. Arduino IDE -->
+1 -1
View File
@@ -1,4 +1,4 @@
# LORA模块
# LORA - LoRa节点模块(433MHz)
<img src="assets/img/product_pics/module/module_lora_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lora_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lora_03.png" width="30%" height="30%">
+1 -1
View File
@@ -1,4 +1,4 @@
# LoRaWAN
# LoRaWAN - LoRa节点模块(433/470MHz和868/915MHz)
<img src="assets/img/product_pics/module/module_lorawan_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_lorawan_02.png" width="30%" height="30%">
-48
View File
@@ -1,48 +0,0 @@
# M5Stack PLC Module
<img src="assets/img/product_pics/module/module_plc_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_plc_02.png" width="30%" height="30%">
***
:memo:**[Description](#Description)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[Example](#Example)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[Schematic](#Schematic)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[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/)**
+19 -25
View File
@@ -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);
}
```
+1 -1
View File
@@ -1,4 +1,4 @@
# PROTO模块
# PROTO - 万能板模块
<img src="assets/img/product_pics/module/module_proto_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_proto_02.png" width="30%" height="30%">
+19 -5
View File
@@ -1,14 +1,16 @@
# SERVO
# SERVO - 舵机驱动模块
<img src="assets/img/product_pics/module/module_servo_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_servo_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_servo_03.png" width="30%" height="30%">
***
:memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](#例程)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[原理图](#原理图)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.6c6f425e2rHsr9&id=581189197514)**
:memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](#例程)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.6c6f425e2rHsr9&id=581189197514)**
<!-- :memo:**[描述](#描述)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[例程](#例程)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:electric_plug:**[原理图](#原理图)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.6c6f425e2rHsr9&id=581189197514)** -->
## 描述
Servo是一个普通舵机(比如常见的9g舵机)驱动模块,它理论上可以同时驱动12路舵机。可是实际测试中,因为同时带动12路舵机时,电流很大,所以这个模块暂时能同时驱动9路舵机。过段时间,我们会推出改进升级版本,敬请期待。
<mark>Servo</mark>是一个普通舵机(比如常见的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 <Arduino.h>
@@ -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);

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