diff --git a/docs/en/app/bala.md b/docs/en/app/bala.md index 8f22f28f..016a9caf 100644 --- a/docs/en/app/bala.md +++ b/docs/en/app/bala.md @@ -1,6 +1,6 @@ # BALA - Balanced Car - + * * * @@ -46,3 +46,7 @@ Weight | 56g - 1x Motor Driver - 2x N20(Encoder included) - Type-C USB Cable + + + + diff --git a/docs/en/base/btc_base.md b/docs/en/base/btc_base.md index f52545a9..1643c48d 100644 --- a/docs/en/base/btc_base.md +++ b/docs/en/base/btc_base.md @@ -1,6 +1,6 @@ # BTC Base - + @@ -12,7 +12,7 @@ # Description -The M5Stack BTC Module is a base including DHT12 module which can detect +BTC is a base including DHT12 module which can detect temperature and humidity. Your M5Stack Core board can stay as a small displayer(like a small TV or a small IOT central contronller) after adding this BTC Module. Absolutely, it is more easier to charge M5Stack @@ -28,16 +28,16 @@ Core via Type-C Cable after adding this BTC Module. - M3 x 16 - Tools + + # PinMap **DHT12** -| DHT12 | ESP32 | -| :----------: |:------------:| -| SCL | G22 | -| GND | GND | -| SDA | G21 | -| 3V3 | 3V3 | + + + +
ESP32 ChipGPIO22GNDGPIO213V3
DHT12SCLGNDSDA3V3
@@ -52,6 +52,8 @@ Core via Type-C Cable after adding this BTC Module. ### Arduino IDE +*If you want the code `BTC.ino`, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino).* + ```arduino #include #include "DHT12.h" @@ -77,5 +79,3 @@ void loop() { delay(100); } ``` - -For specific example `BTC.ino`, click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino) please. \ No newline at end of file diff --git a/docs/en/base/node_base.md b/docs/en/base/node_base.md index 299e4ad7..198156ca 100644 --- a/docs/en/base/node_base.md +++ b/docs/en/base/node_base.md @@ -1,9 +1,12 @@ -# Node Module +# Node Base - + *** -:memo:**[Description](#Description)**      :octocat:**[Example](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**      :electric_plug:**[Schematic](https://github.com/m5stack/Bases-Node/tree/master/schematic)**      🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-New-NODE-Samrt-Speaker-WM8978-Audio-Development-Board-I2S-Module-with-DHT12-Sensor-MIC-IR/3226069_32949773234.html)** + +:memo:**[Description](#Description)**      :octocat:**[Example](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**      🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-New-NODE-Samrt-Speaker-WM8978-Audio-Development-Board-I2S-Module-with-DHT12-Sensor-MIC-IR/3226069_32949773234.html)** + + ## Description @@ -34,6 +37,8 @@ - Webradio - Intelligent sound box + + ## Related Link -- **[WM8978](http://pdf1.alldatasheet.com/datasheet-pdf/view/96647/WOLFSON/WM8978.html) (WM8978)** +- **数据手册** - [WM8978](http://pdf1.alldatasheet.com/datasheet-pdf/view/96647/WOLFSON/WM8978.html) diff --git a/docs/en/module/sim800.md b/docs/en/module/sim800.md index 63b860dc..9d7bac5a 100644 --- a/docs/en/module/sim800.md +++ b/docs/en/module/sim800.md @@ -54,8 +54,8 @@ SIM800L is a complete Quad-band GSM/GPRS solution. You can easily control SIM800 - **[Forum](http://forum.m5stack.com/)** -- **[SIM800L Info](http://simcomm2m.com/En/module/detail.aspx?id=138)** - (SIM800L) + - Two Lego installation holes ## APPLICATION diff --git a/docs/en/unit/dac.md b/docs/en/unit/dac.md index 3c51f1fe..37738338 100644 --- a/docs/en/unit/dac.md +++ b/docs/en/unit/dac.md @@ -16,7 +16,7 @@ This is a unit can convert digital signal to analog signal like voltage waveform - Up to 12 bits of resolution - Output 0~3.3V voltage -- GROVE interface, support [UiFlow](http://flow.m5stack.com) and [Arduino](http://www.arduino.cc) + - Two Lego installation holes ## APPLICATION diff --git a/docs/ja/base/btc_base.md b/docs/ja/base/btc_base.md index 067a5f4e..19c3a8de 100644 --- a/docs/ja/base/btc_base.md +++ b/docs/ja/base/btc_base.md @@ -1,6 +1,6 @@ # BTC ベース - + @@ -24,16 +24,16 @@ BTCベースはDHT12を内蔵しており、周囲の温度、湿度を検出す - M3 x 16 ネジ - ツール + + # ピンマップ **DHT12** -| DHT12 | ESP32 | -|:------:|:------:| -| SCL | G22 | -| GND | GND | -| SDA | G21 | -| 3V3 | 3V3 | + + + +
ESP32 ChipGPIO22GNDGPIO213V3
DHT12SCLGNDSDA3V3
@@ -47,6 +47,8 @@ BTCベースはDHT12を内蔵しており、周囲の温度、湿度を検出す ### Arduino IDE +`BTC.ino`サンプルは[こちら](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino)から。 + ```arduino #include #include "DHT12.h" @@ -72,5 +74,3 @@ void loop() { delay(100); } ``` - -`BTC.ino`サンプルは[こちら](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino)から。 \ No newline at end of file diff --git a/docs/ja/base/node_base.md b/docs/ja/base/node_base.md index 7453eb20..475c2741 100644 --- a/docs/ja/base/node_base.md +++ b/docs/ja/base/node_base.md @@ -1,6 +1,10 @@ # Node ベース + +*** + +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**      🛒**[购买链接](https://www.aliexpress.com/store/product/M5Stack-New-NODE-Samrt-Speaker-WM8978-Audio-Development-Board-I2S-Module-with-DHT12-Sensor-MIC-IR/3226069_32949773234.html)** ## 概要 @@ -32,6 +36,8 @@ - Bluetoothスピーカー - インテリジェントサウンドボックス + + ## ドキュメント - **ウェブサイト** diff --git a/docs/ja/module/battery.md b/docs/ja/module/battery.md index 2f5474a4..d9361896 100644 --- a/docs/ja/module/battery.md +++ b/docs/ja/module/battery.md @@ -8,7 +8,7 @@ ## 概要 -**BATTERY**モジュールは850mAhの大容量バッテリを内蔵しています。 +**BATTERY**モジュールは**850mAh**の大容量バッテリを内蔵しています。 これによりM5Stack単独で動作するポータブルデバイスを開発する事が可能です。 @@ -25,4 +25,3 @@ - **[公式ビデオ](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** - **[フォーラム](http://forum.m5stack.com/)** - diff --git a/docs/ja/module/commu.md b/docs/ja/module/commu.md index 3c8f0ac0..c6327a64 100644 --- a/docs/ja/module/commu.md +++ b/docs/ja/module/commu.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-COMMU-Module-Extend-RS485-TTL-CAN-I2C-Port-with-MCP2515-TJA1051-SP3485-Development-Board/3226069_32954475633.html?spm=a2g1y.12024536.productList_5885013.subject_2)** +:memo:**[概要](#概要)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-COMMU-Module-Extend-RS485-TTL-CAN-I2C-Port-with-MCP2515-TJA1051-SP3485-Development-Board/3226069_32954475633.html?spm=a2g1y.12024536.productList_5885013.subject_2)** + + ## 概要 @@ -46,12 +48,12 @@ - **データシート** - [MCP2515](http://ww1.microchip.com/downloads/en/devicedoc/20001801h.pdf) - [TJA1051](https://www.nxp.com/docs/en/data-sheet/TJA1051.pdf) - [SP3485](https://www.exar.com/ds/sp3485.pdf) -## サンプルコード + -## 回路図 + \ No newline at end of file diff --git a/docs/ja/module/gps.md b/docs/ja/module/gps.md index 4812d296..350a5305 100644 --- a/docs/ja/module/gps.md +++ b/docs/ja/module/gps.md @@ -40,9 +40,49 @@ ## サンプルコード -### 1. Arduino IDE +### Arduino IDE -### 2. UIFlow +*特定のルーチン`GPSRaw.ino`クリックしてください[ここで](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/GPS/Arduino)。* + +```arduino +#include + +/* By default, GPS is connected with M5Core through UART2 */ +HardwareSerial GPSRaw(2); + +void setup() { + M5.begin(); + GPSRaw.begin(9600);// GPS init + Serial.println("hello"); + termInit(); +} + +void loop() { + // put your main code here, to run repeatedly: + if(Serial.available()) { + int ch = Serial.read(); + GPSRaw.write(ch); + } + if(GPSRaw.available()) { + int ch = GPSRaw.read();// read GPS information + Serial.write(ch); + termPutchar(ch); + } +} +``` + +ダウンロードルーチン`GPSRaw.ino`後に, シリアルディスプレイ端末は以下の同様の情報を印刷します. + +``` +$GPGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5*02 +$BDGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5*13 +$GPGSV,1,1,00*79 +$BDGSV,1,1,00*68 +$GNRMC,,V,,,,,,,,,,M*4E +$GNVTG,,,,,,,,,M*2D +$GNZDA,,,,,,*56 +$GPTXT,01,01,01,ANTENNA OPEN*25 +``` ## 回路図 diff --git a/docs/ja/module/lego_plus.md b/docs/ja/module/lego_plus.md index 2de16eb3..8269f05b 100644 --- a/docs/ja/module/lego_plus.md +++ b/docs/ja/module/lego_plus.md @@ -25,12 +25,18 @@ - **[フォーラム](http://forum.m5stack.com/)** +- **[モジュール内のMEGA328ファームウェア](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LEGO_PLUS/firmware_328p)** + ## サンプルコード -### 1. Arduino IDE + ### 2. UIFlow +*特定のルーチンをクリックしてください[ルーチン](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LEGO_PLUS/UIFlow)。* + + + \ No newline at end of file diff --git a/docs/ja/module/lora.md b/docs/ja/module/lora.md index 8f60c0e8..beb1bd35 100644 --- a/docs/ja/module/lora.md +++ b/docs/ja/module/lora.md @@ -1,10 +1,12 @@ -# LORA モジュール +# LORA モジュール(433MHz) *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-Stock-Offer-LoRa-Module-for-ESP32-DIY-Development-Kit-Wireless-433MHz-Built-in-Antenna/3226069_32839736315.html?spm=2114.12010615.8148356.22.25e96be7xE1y22.html)** +:memo:**[概要](#概要)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-Stock-Offer-LoRa-Module-for-ESP32-DIY-Development-Kit-Wireless-433MHz-Built-in-Antenna/3226069_32839736315.html?spm=2114.12010615.8148356.22.25e96be7xE1y22.html)** + + ## 概要 @@ -45,12 +47,12 @@ LoRa™は少ない消費電力で広いエリアをカバーする無線通信 digitalWrite(5,HIGH); m5.begin(); ``` -## サンプルコード + diff --git a/docs/ja/module/lorawan.md b/docs/ja/module/lorawan.md index 2a137f84..81696079 100644 --- a/docs/ja/module/lorawan.md +++ b/docs/ja/module/lorawan.md @@ -1,10 +1,12 @@ -# LoRaWAN モジュール +# LoRaWAN モジュール(433/470MHz和868/915MHz) - + *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-LoRaWAN-Module-433-470Mhz-868-915MHz-with-Internal-Antenna-and-MCX-External-Antenna-Port/3226069_32953098569.html?spm=a2g1y.12024536.productList_5885011.pic_2)** +:memo:**[概要](#概要)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-LoRaWAN-Module-433-470Mhz-868-915MHz-with-Internal-Antenna-and-MCX-External-Antenna-Port/3226069_32953098569.html?spm=a2g1y.12024536.productList_5885011.pic_2)** + + ## 概要 @@ -49,10 +51,85 @@ ## サンプルコード -### 1. Arduino IDE +### Arduino IDE -### 2. UIFlow +これはピアツーピア通信のためのルーチンです. -## 回路図 +*特定のルーチンをクリックしてください[ルーチン](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LORAWAN/Arduino)。* + +```arduino +/* + Master.ino +*/ + +#include + +// entry test mode +String cmd_test_mode = "AT+Mode=Test"; +// Configure the modem,like Freq, SF, BW, Preamble length, TX output power +String cmd_rfconf = "AT+TEST=RFCFG,472.3,8,250,8,8,20"; +// send data as HEX format +String cmd_send_data = "AT+TEST=TXLRPKT,\"30 31 32 33 34 35\""; + +void setup() { + M5.begin(); + Serial.begin(9600); + Serial2.begin(9600, SERIAL_8N1, 16, 17); + + delay(1000);// delay for lorawan power on + /* LoRaWAN Init */ + Serial2.println(cmd_test_mode); + delay(500); + Serial2.println(cmd_rfconf); + delay(500); +} + +void loop() { + if(M5.BtnA.wasPressed()) { + Serial2.println(cmd_send_data); + Serial.println(cmd_send_data); + } + M5.update(); +} +``` + +```arduino +/* + Slaver.ino +*/ + +#include + +// entry test mode +String cmd_test_mode = "AT+Mode=Test"; +// Configure the modem,like Freq, SF, BW, Preamble length +String cmd_rfconf = "AT+TEST=RFCFG,472.3,8,250,8,8,20"; +// allow to receive data +String cmd_receive_data = "AT+TEST=RXLRPKT"; + +void setup() { + M5.begin(); + Serial.begin(9600); + Serial2.begin(9600, SERIAL_8N1, 16, 17); + delay(1000);// delay for lorawan power on + /* LoRaWAN Init */ + Serial2.println(cmd_test_mode); + delay(500); + Serial2.println(cmd_rfconf); + delay(500); + Serial2.println(cmd_receive_data); + delay(500); +} + +void loop() { + if(Serial2.available()) { + int ch = Serial2.read(); + M5.Lcd.print((char)ch); + Serial.write(ch); + } +} +``` + + \ No newline at end of file diff --git a/docs/ja/module/plus.md b/docs/ja/module/plus.md index 5830f6e5..8a693546 100644 --- a/docs/ja/module/plus.md +++ b/docs/ja/module/plus.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-Arrival-PLUS-Module-Encoder-Module-with-MEGA328P-500mAh-Battery-ISP-IR-Transmitter-UART-GPIO/3226069_32949278724.html?spm=a2g1x.12024536.productList_5885013.pic_1)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-Arrival-PLUS-Module-Encoder-Module-with-MEGA328P-500mAh-Battery-ISP-IR-Transmitter-UART-GPIO/3226069_32949278724.html?spm=a2g1x.12024536.productList_5885013.pic_1)** + + ## 概要 @@ -28,11 +30,49 @@ - **[フォーラム](http://forum.m5stack.com/)** +- **[モジュール内のMEGA328ファームウェア](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/PLUS/firmware_328p)** + ## サンプルコード ### 1. Arduino IDE -### 2. UIFlow +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/PLUS/Arduino)`plus_read_encoder.ino`.* + + +```arduino +/* +* ギアポテンショメータのデータを読む +* 赤外線ライト +*/ +#include +#include + +#define IrPin 13 +#define PLUS_ADDR 0x62 + +// declaration +int32_t number = 0; +uint8_t press = 0; + +// 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 + } +} +``` diff --git a/docs/ja/module/servo.md b/docs/ja/module/servo.md index bccbabfe..c9e2f424 100644 --- a/docs/ja/module/servo.md +++ b/docs/ja/module/servo.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-SERVO-Module-Board-12-Channels-Servo-Controller-with-MEGA328-Inside-Power-Adapter-6-24V/3226069_32951356502.html?spm=a2g1y.12024536.productList_5885011.pic_0)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-SERVO-Module-Board-12-Channels-Servo-Controller-with-MEGA328-Inside-Power-Adapter-6-24V/3226069_32951356502.html?spm=a2g1y.12024536.productList_5885011.pic_0)** + + ## 概要 @@ -38,11 +40,59 @@ - **[フォーラム](http://forum.m5stack.com/)** +- **[モジュール内のMEGA328ファームウェア](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/SERVO/firmware_328p)** + ## サンプルコード ### 1. Arduino IDE -### 2. UIFlow +*例程下载请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/SERVO/Arduino)。* + +```arduino +#include +#include +#include + +#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 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); + Wire.write(us & 0x00ff); + Wire.write(us >> 8 & 0x00ff); + 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); + // Servo_write_angle(i, 0); + } + delay(1000); + for(uint8_t i = 0; i < 12; i++){ + Servo_write_us(i, 2300); + // Servo_write_angle(i, 180); + } + delay(1000); +} +``` diff --git a/docs/ja/module/sim800.md b/docs/ja/module/sim800.md index fc326b68..ee2eb03b 100644 --- a/docs/ja/module/sim800.md +++ b/docs/ja/module/sim800.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-In-Stock-GSM-Module-SIM800L-Stackable-IoT-Development-Board-for-Arduino-ESP32-with-MIC/3226069_32843211923.html?spm=2114.12010615.8148356.20.25e96be7xE1y22.html)** +:memo:**[概要](#概要)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-In-Stock-GSM-Module-SIM800L-Stackable-IoT-Development-Board-for-Arduino-ESP32-with-MIC/3226069_32843211923.html?spm=2114.12010615.8148356.20.25e96be7xE1y22.html)** + + ## 概要 @@ -53,13 +55,13 @@ M5Stackシリーズのコアを使用し、Blockly、Arduino、MicroPythonでプ - **[フォーラム](http://forum.m5stack.com/)** -- **データシート** - [SIM800L](http://simcomm2m.com/En/module/detail.aspx?id=138)(SIM800L) + -## サンプルコード + diff --git a/docs/ja/module/stepmotor.md b/docs/ja/module/stepmotor.md index c64b73b2..c8729038 100644 --- a/docs/ja/module/stepmotor.md +++ b/docs/ja/module/stepmotor.md @@ -1,12 +1,14 @@ # STEPMOTOR モジュール - + *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-Arrival-Stepmotor-Module-for-Arduino-ESP32-GRBL-12C-Step-Motor-MEGA328P-similar-as-12V/3226069_32889109142.html?spm=2114.12010612.8148356.17.50511b9b5ViNuz)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-New-Arrival-Stepmotor-Module-for-Arduino-ESP32-GRBL-12C-Step-Motor-MEGA328P-similar-as-12V/3226069_32889109142.html?spm=2114.12010612.8148356.17.50511b9b5ViNuz)** + + ## 概要 @@ -39,8 +41,48 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/stepmotor_module/tree/master/Example/Arduino)。* + +```adrduino +/* + If Button A was pressed, + stepmotor will rotate back and forth at a time +*/ + +#include +#include + +#define STEPMOTOR_I2C_ADDR 0x70 + +// initialization +M5.begin(); +Wire.begin(); + +// Controlling Protocol: +// G XYZ F +SendCommand(STEPMOTOR_I2C_ADDR, "G1 X20Y20Z20 F500"); +SendCommand(STEPMOTOR_I2C_ADDR, "G1 X0Y0Z0 F400"); + +// Get Data from Module. +Wire.requestFrom(STEPMOTOR_I2C_ADDR, 1); +if (Wire.available() > 0) { + int u = Wire.read(); + if (u != 0) Serial.write(u); +} + +// Send Data to Module. +while (Serial.available() > 0) { + int inByte = Serial.read(); + SendByte(STEPMOTOR_I2C_ADDR, inByte); +} +``` + ### 2. UIFlow +*特定のルーチンをクリックしてください[ルーチン](https://github.com/m5stack/stepmotor_module/tree/master/Example/UIFlow)。* + + + \ No newline at end of file diff --git a/docs/ja/module/usb.md b/docs/ja/module/usb.md index 36392253..34b7e4b7 100644 --- a/docs/ja/module/usb.md +++ b/docs/ja/module/usb.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      :electric_plug:**[回路図](#回路図)**      🛒**[購入リンク](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.13.1dbd425eDUpt0Z&id=583599151180)** +:memo:**[概要](#概要)**      🛒**[購入リンク](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.13.1dbd425eDUpt0Z&id=583599151180)** + + ## 概要 @@ -33,11 +35,11 @@ - **データシート** - [MAX3421E](https://www.sparkfun.com/datasheets/DevTools/Arduino/MAX3421E.pdf) -## サンプルコード + diff --git a/docs/ja/unit/adc.md b/docs/ja/unit/adc.md index d8919329..571a12ab 100644 --- a/docs/ja/unit/adc.md +++ b/docs/ja/unit/adc.md @@ -17,6 +17,7 @@ - 増幅率変更可能 - 利得 1, 2, 4, 8 dB - 0〜12Vの電圧入力を検出可能 - 2種類の変換モード - 連続モード、ワンショットモード + - LEGO 互換ホール ## アプリケーション @@ -29,17 +30,46 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/ADC_ADS1100).* -### 2. UIFlow +```arduino +#include +#include +#include "ADS1100.h" + +// declaration +byte error; +int8_t address; + +//new a object +ADS1100 ads; + +// initialization +M5.begin(true, false, false); +ads.getAddr_ADS1100(ADS1100_DEFAULT_ADDRESS);// 0x48, 1001 000 (ADDR = GND) +ads.setGain(GAIN_ONE); // 1x gain(default) +ads.setMode(MODE_CONTIN); // Continuous conversion mode (default) +ads.setRate(RATE_8); // 8SPS (default) +ads.setOSMode(OSMODE_SINGLE); // Set to start a single-conversion +ads.begin(); + +// read data +address = ads.ads_i2cAddress; +Wire.beginTransmission(address); +Wire.endTransmission(); +ads.Measure_Differential(); +``` + + ## 回路図 -### PinMap +### ピンマッピング - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
ADC UnitSCLSDA5VGND
diff --git a/docs/ja/unit/angle.md b/docs/ja/unit/angle.md index 124f922c..eed0b4c2 100644 --- a/docs/ja/unit/angle.md +++ b/docs/ja/unit/angle.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](#購入リンク)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](#購入リンク)** + + ## 概要 @@ -12,25 +14,48 @@ ## 特徴 +- サポート[UiFlow](http://flow.m5stack.com)プログラミング, [Arduino](http://www.arduino.cc)プログラミング - LEGO 互換ホール ## サンプルコード ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ANGLE/Arduino).* + +```arduino +#include + +// select the input pin for the potentiometer +#define sensorPin 36 + +// declaration +int cur_sensorValue = 0; + +// initialization +M5.begin(); +pinMode(sensorPin, INPUT); + +// read data +cur_sensorValue = analogRead(sensorPin); +``` ### 2. UIFlow -## 回路図 +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ANGLE/UIFlow).* - + -### PinMap + + +### ピンマッピング
- - + +
M5Core(GROVE B)GPIO36GPIO265VGND
ANGLE UnitANGLE Pin 5VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
角度センサーUnitセンサーピン 5VGND
## 関連リンク diff --git a/docs/ja/unit/button.md b/docs/ja/unit/button.md index c42b29db..e55a948f 100644 --- a/docs/ja/unit/button.md +++ b/docs/ja/unit/button.md @@ -26,10 +26,10 @@ -### PinMap +### ピンマッピング - +
M5Core(GROVE B)GPIO36GPIO265VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
BUTTON UnitGPIO36GPIO265VGND
diff --git a/docs/ja/unit/color.md b/docs/ja/unit/color.md index a9854100..a09c3eb0 100644 --- a/docs/ja/unit/color.md +++ b/docs/ja/unit/color.md @@ -8,7 +8,7 @@ ## 概要 -**COLOR SENSOR**ユニットは内蔵されたTCS3472により、対象物表面の色を検出する事ができます。M5StackはI2Cで値を取得可能です。 +**COLOR SENSOR**ユニットは内蔵された**TCS3472**により、対象物表面の色を検出する事ができます。M5StackはI2Cで値を取得可能です。 ## 特徴 @@ -20,24 +20,73 @@ - RGB LED バックライトコントロール - 色校正 -## ドキュメント +## サンプルコード -- **GitHub** - - [Arduino](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/Color) +### 1. Arduino IDE -- **データシート** - - [TCS3472](https://pdf1.alldatasheet.com/datasheet-pdf/view/560511/AMSCO/TCS3472.html) +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/COLOR/Arduino).* -- **回路図** - - [回路図](https://github.com/m5stack/M5Stack) +```arduino +/* + Color test + hardware: M5Stack -
- M5GO_Unit_color -
-
- M5GO_Unit_color_02 -
+ please install the Adfruit TCS34725 library first ... +*/ +#include +#include +#include "Adafruit_TCS34725.h" -## 関連情報 +// declaration +uint16_t clear, red, green, blue; +// set to false if using a common cathode LED +#define commonAnode true +// our RGB -> eye-recognized gamma color +byte gammatable[256]; -- [COLOR SENSOR ユニット 購入(AliExpress)](https://www.aliexpress.com/store/product/M5Stack-TCS34725-RGB-I2C/3226069_32946957647.html) \ No newline at end of file +// new a object +Adafruit_TCS34725 tcs; +tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS,TCS34725_GAIN_4X); + +// other function +static uint16_t color16(uint16_t r, uint16_t g, uint16_t b) { + uint16_t _color; + _color = (uint16_t)(r & 0xF8) << 8; + _color |= (uint16_t)(g & 0xFC) << 3; + _color |= (uint16_t)(b & 0xF8) >> 3; + return _color; +} + +// initialization +M5.begin(true, false, false); +tcs.begin(); +tcs.setIntegrationTime(TCS34725_INTEGRATIONTIME_154MS); +tcs.setGain(TCS34725_GAIN_4X); + +// read data +tcs.getRawData(&red, &green, &blue, &clear); +// Figure out some basic hex code for visualization +uint32_t sum = clear; +float r, g, b; +r = red; r /= sum; g = green; g /= sum; b = blue; b /= sum; +r *= 256; g *= 256; b *= 256; +uint16_t _color = color16((int)r, (int)g, (int)b); +``` + +ルーチンを燃やした後, シリアルディスプレイ端末は元の値を印刷します + +下の図は、検知用の赤い紙の出力を示しています + + + +## 回路図 + + + +## 関連リンク + +- **[公式ビデオ](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** + +- **[フォーラム](http://forum.m5stack.com/)** + +- **データシート** - [TCS3472](https://pdf1.alldatasheet.com/datasheet-pdf/view/560511/AMSCO/TCS3472.html) \ No newline at end of file diff --git a/docs/ja/unit/dac.md b/docs/ja/unit/dac.md index c8e9ce67..aeb09568 100644 --- a/docs/ja/unit/dac.md +++ b/docs/ja/unit/dac.md @@ -29,3 +29,48 @@ - **データシート** - [MCP4725](http://pdf1.alldatasheet.com/datasheet-pdf/view/233449/MICROCHIP/MCP4725.html) + +## サンプルコード + +### 1. Arduino IDE + +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/ADC_ADS1100).* + +```arduino +#include +#include +#include "ADS1100.h" + +// declaration +byte error; +int8_t address; + +//new a object +ADS1100 ads; + +// initialization +M5.begin(true, false, false); +ads.getAddr_ADS1100(ADS1100_DEFAULT_ADDRESS);// 0x48, 1001 000 (ADDR = GND) +ads.setGain(GAIN_ONE); // 1x gain(default) +ads.setMode(MODE_CONTIN); // Continuous conversion mode (default) +ads.setRate(RATE_8); // 8SPS (default) +ads.setOSMode(OSMODE_SINGLE); // Set to start a single-conversion +ads.begin(); + +// read data +address = ads.ads_i2cAddress; +Wire.beginTransmission(address); +Wire.endTransmission(); +ads.Measure_Differential(); +``` + +## 回路図 + + + +### ピンマッピング + + + + +
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
DAC UnitSCLSDA5VGND
\ No newline at end of file diff --git a/docs/ja/unit/dual_button.md b/docs/ja/unit/dual_button.md index 2d0a7e25..ec3bf00b 100644 --- a/docs/ja/unit/dual_button.md +++ b/docs/ja/unit/dual_button.md @@ -4,7 +4,7 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](#購入リンク)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](#購入リンク)** ## 概要 @@ -19,18 +19,43 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/DUAL_BUTTON/Arduino).* + +```arduino +#include + +// declaration +int cur_value_red = 0; +int cur_value_blue = 0; + +// initialization +M5.begin(); +pinMode(26, INPUT);// Red Button Pin setting +pinMode(36, INPUT);// Blue Button Pin setting + +// read data +cur_value_red = digitalRead(26); +cur_value_blue = digitalRead(36); +M5.update(); +``` ### 2. UIFlow -## 回路図 +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/DUAL_BUTTON/UIFlow).* + + + + + + -### PinMap +### ピンマッピング - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
DUAL_BUTTON UnitGPIO36GPIO265VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
DUAL_BUTTON Unit青いボタンピン赤いボタンピン5VGND
## 関連リンク diff --git a/docs/ja/unit/earth.md b/docs/ja/unit/earth.md index fa04ba0b..c232ed4c 100644 --- a/docs/ja/unit/earth.md +++ b/docs/ja/unit/earth.md @@ -15,24 +15,50 @@ - 10KΩ調整抵抗による閾値調整可能 - アナログ & デジタル出力 - Grove インターフェース +- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 - LEGO 互換ホール ## サンプルコード ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/EARTH/Arduino).* + +```arduino +#include + +void setup() { + M5.begin(); + dacWrite(25, 0);//disable the speak noise + + pinMode(26, INPUT);// set digital pin +} + +uint16_t analogRead_value = 0; +uint16_t digitalRead_value = 0; + +void loop() { + analogRead_value = analogRead(36);// read analog value of EARTH + digitalRead_value = digitalRead(26);// read digital value of EARTH +} + +``` ### 2. UIFlow +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/EARTH/UIFlow).* + + + ## 回路図 -### PinMap +### ピンマッピング - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
EARTH UnitAinDin5VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
EARTH Unitアナログ値出力端子デジタル値出力端子5VGND
## 関連リンク diff --git a/docs/ja/unit/env.md b/docs/ja/unit/env.md index 19f7e73d..03f1fba0 100644 --- a/docs/ja/unit/env.md +++ b/docs/ja/unit/env.md @@ -21,6 +21,7 @@ - 気圧: - 計測範囲: 300 ~ 1100hPa - 精度: ±1hPa +- サポート[UiFlow](http://flow.m5stack.com)プログラミング, [Arduino](http://www.arduino.cc)プログラミング - LEGO 互換ホール ## 関連リンク @@ -33,9 +34,38 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/ENV).* + +```arduino +/* + Install Adafruit BMP280 Library first. +*/ +#include +#include "DHT12.h" +#include //The DHT12 uses I2C comunication. +#include +#include + +// new two objects +DHT12 dht12; +Adafruit_BMP280 bme; + +// initialization +M5.begin(); +Wire.begin(); +bme.begin(); + +// read data +float tmp = dht12.readTemperature(); +float hum = dht12.readHumidity(); +float pressure = bme.readPressure(); +``` ### 2. UIFlow +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ENV/UIFlow).* + + ## 回路図 @@ -44,6 +74,6 @@ ### ピンマップ - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
ENV UnitSCLSDA5VGND
\ No newline at end of file diff --git a/docs/ja/unit/ir.md b/docs/ja/unit/ir.md index 19530dfc..d66d1a7b 100644 --- a/docs/ja/unit/ir.md +++ b/docs/ja/unit/ir.md @@ -14,15 +14,37 @@ - IR送受信機 - 検出距離 2 ~ 5cm +- サポート[UiFlow](http://flow.m5stack.com)プログラミング, [Arduino](http://www.arduino.cc)プログラミング - LEGO 互換ホ ## サンプルコード ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/IR/Arduino).* + +```arduino +#include + +// declaration +int cur_recv_value = 0; + +// initialization +M5.begin(); +pinMode(ir_recv_pin, INPUT);// receiver pin +pinMode(ir_send_pin, OUTPUT);// transmitter pin +digitalWrite(ir_send_pin, 1);// send infrared light + +// read data +cur_recv_value = digitalRead(ir_recv_pin);// read the status of receiver +``` ### 2. UIFlow +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/IR/UIFlow).* + + + ## 回路図 @@ -30,8 +52,8 @@ ### ピンマップ - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
IR UnitReceiver PinTransmitter Pin5VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
赤外線チューブUnit赤外線受光ピン赤外線送信機ピン5VGND
## 関連リンク diff --git a/docs/ja/unit/joystick.md b/docs/ja/unit/joystick.md index 2df22099..66b2314e 100644 --- a/docs/ja/unit/joystick.md +++ b/docs/ja/unit/joystick.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-New-Joystick-Unit-MEGA328P-I2C-Grove-Connector-Compatible-X-Y-Axis-Button-for-ESP32/3226069_32921785624.html?spm=a2g1x.12024536.productList_2187621.10)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-New-Joystick-Unit-MEGA328P-I2C-Grove-Connector-Compatible-X-Y-Axis-Button-for-ESP32/3226069_32921785624.html?spm=a2g1x.12024536.productList_2187621.10)** + + ## 概要 @@ -19,16 +21,49 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/JOYSTICK/Arduino).* + +```arduino +#include +#include "Wire.h" + +#define JOY_ADDR 0x52 + +// declaration +uint8_t x_data, y_data, button_data; +char data[100]; + +// initialization +M5.begin(); +M5.Lcd.clear(); +dacWrite(25, 0);//disable the speak noise +Wire.begin(21, 22, 400000); + + +// read data +Wire.requestFrom(JOY_ADDR, 3); +if (Wire.available()) { + x_data = Wire.read();// X(range: 10~250) + y_data = Wire.read();// Y(range: 10~250) + button_data = Wire.read();// Z(0: released 1: pressed) + sprintf(data, "x:%d y:%d button:%d\n", x_data, y_data, button_data); +} +``` + ### 2. UIFlow -## 回路図 +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/JOYSTICK/UIFlow).* + + + + ### ピンマップ - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
JOYSTICK UnitSCLSDA5VGND
diff --git a/docs/ja/unit/light.md b/docs/ja/unit/light.md index 1ed9c741..df6c4154 100644 --- a/docs/ja/unit/light.md +++ b/docs/ja/unit/light.md @@ -21,9 +21,31 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/LIGHT/Arduino).* + +```arduino +#include + +// declaration +uint16_t analogRead_value = 0; +uint16_t digitalRead_value = 0; + +// initialization +M5.begin(); +dacWrite(25, 0);// disable the speak noise +pinMode(26, INPUT);// LIGHT Pin setting + +// read data +analogRead_value = analogRead(36);// read analog value of LIGHT +digitalRead_value = digitalRead(26); +``` ### 2. UIFlow +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/LIGHT/UIFlow).* + + + ## 回路図 @@ -31,8 +53,8 @@ ### ピンマップ - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
LIGHT UnitAinDin5VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
LIGHT Unitアナログ値出力端子デジタル値出力端子5VGND
## 関連リンク diff --git a/docs/ja/unit/makey.md b/docs/ja/unit/makey.md index 64f8fa73..99129441 100644 --- a/docs/ja/unit/makey.md +++ b/docs/ja/unit/makey.md @@ -1,10 +1,10 @@ # MAKEY ユニット - + *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-Makey-Unit-MEGA328P-Inside-16Key-Fruit-Paino-with-NEO-Pixel-and-BUZZER-for-ESP32/3226069_32924883456.html?spm=a2g1y.12024536.productList_5885013.subject_23)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-Makey-Unit-MEGA328P-Inside-16Key-Fruit-Paino-with-NEO-Pixel-and-BUZZER-for-ESP32/3226069_32924883456.html?spm=a2g1y.12024536.productList_5885013.subject_23)** ## 概要 @@ -18,33 +18,67 @@ - 1x Buzzer pin(PC3) - ブザー内蔵 - Grove インターフェース +- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 - LEGO 互換ホール ## アプリケーション -- Makeyアプリケーション +- フルーツピアノ - Adafruitのライブラリを用いたRGB アプリケーション + + ## サンプルコード ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/MAKEY/Arduino).* + +```arduino +#include +#include + +// initialization +M5.begin(); +pinMode(21, INPUT); pinMode(22, INPUT); +Wire.begin();// Init I2C + +// read data +Wire.requestFrom(MAKEY_ADDR, 2); +while (Wire.available()) { + Key1 = Wire.read();//read data from MAKEY + Key2 = Wire.read();//read data from MAKEY + tone_key = (Key2<<8) | Key1;// the following picture will explain "tone_key" +} +``` + + + + ### 2. UIFlow -## 回路図 +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/MAKEY/UIFlow).* - + + + ### ピンマップ - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
MAKEY UnitSCLSDA5VGND
+ + ## 関連リンク - **[公式ビデオ](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** -- **[フォーラム](http://forum.m5stack.com/)** \ No newline at end of file +- **[フォーラム](http://forum.m5stack.com/)** + +- **[モジュール内のMEGA328ファームウェア](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/Makey_NewVersion/firmware_328p)** \ No newline at end of file diff --git a/docs/ja/unit/ncir.md b/docs/ja/unit/ncir.md index a885f94f..ce2b403f 100644 --- a/docs/ja/unit/ncir.md +++ b/docs/ja/unit/ncir.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-NCIR-Unit-MLX90614-Contactless-Temperature-Sensor-Module-70C-382-2C-GROVE-I2C-Development-Board/3226069_32947772098.html?spm=a2g1x.12024536.productList_5885013.pic_4)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-NCIR-Unit-MLX90614-Contactless-Temperature-Sensor-Module-70C-382-2C-GROVE-I2C-Development-Board/3226069_32947772098.html?spm=a2g1x.12024536.productList_5885013.pic_4)** + + ## 概要 @@ -14,6 +16,7 @@ - 高精度 - 検出範囲: -70℃~382.2℃ +- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 - LEGO 互換ホール ## アプリケーション @@ -25,8 +28,31 @@ ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5Stack/tree/master/examples/Unit/NCIR).* -### 2. UIFlow +```arduino +#include +#include + +#define NCIR_ADDR 0x5A + +// declaration +uint16_t result; +float temperature; + +// initialization +Wire.begin(); +M5.begin(); + +// read data +Wire.beginTransmission(NCIR_ADDR);Wire.write(0x07);Wire.endTransmission(false); +Wire.requestFrom(NCIR_ADDR, 2); +result = Wire.read();// Receive DATA +result |= Wire.read() << 8;// Receive DATA + +// store temperature value +temperature = result * 0.02 - 273.15; +``` ## 回路図 @@ -35,7 +61,7 @@ ### ピンマップ - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
NCIR UnitSCLSDA5VGND
diff --git a/docs/ja/unit/neopixel.md b/docs/ja/unit/neopixel.md index 215c5185..051a6bab 100644 --- a/docs/ja/unit/neopixel.md +++ b/docs/ja/unit/neopixel.md @@ -30,7 +30,7 @@ ### ピンマップ - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
NCIR UnitSCLSDA5VGND
diff --git a/docs/ja/unit/pir.md b/docs/ja/unit/pir.md index 6cfa1c02..696d6bc7 100644 --- a/docs/ja/unit/pir.md +++ b/docs/ja/unit/pir.md @@ -13,15 +13,33 @@ ## 特徴 - 測定可能距離 150cm +- サポート[UiFlow](http://flow.m5stack.com)プログラミング, [Arduino](http://www.arduino.cc)プログラミング - LEGO 互換ホール ## サンプルコード ### 1. Arduino IDE +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/PIR/Arduino).* + +```arduino +#include + +// initialization +M5.begin(); +pinMode(36, INPUT);// set pir sensor pin as input + +// read data +int value = digitalRead(36);// read the pin(0: not detectd 1: detected) +M5.update(); +``` ### 2. UIFlow +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/PIR/UIFlow).* + + + ## 回路図 @@ -29,8 +47,8 @@ ### ピンマップ - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
PIR UnitGPIO36GPIO265VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
人体赤外線誘導Unit赤外線検知ピン 5VGND
## 関連リンク diff --git a/docs/ja/unit/relay.md b/docs/ja/unit/relay.md index 89f67c30..2fe764b1 100644 --- a/docs/ja/unit/relay.md +++ b/docs/ja/unit/relay.md @@ -15,6 +15,7 @@ - シングル入力 - 最大 3A @ 24 VDC または 120 VAC - Grove インターフェース +- サポート[UiFlow](http://flow.m5stack.com)プログラミング, [Arduino](http://www.arduino.cc)プログラミング - LEGO 互換ホール ## アプリケーション @@ -26,8 +27,35 @@ ### 1. Arduino IDE +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/RELAY/Arduino).* + +```arduino +#include + +void setup() { + M5.begin(); + M5.Lcd.clear(BLACK); + M5.Lcd.setTextFont(4); + M5.Lcd.setTextColor(YELLOW, BLACK); + //disable the speak noise + dacWrite(25, 0); + pinMode(26, OUTPUT);// RELAY Pin setting +} + +void loop(void) { + digitalWrite(26, HIGH);// RELAY Unit work + delay(500); + digitalWrite(26, LOW);// RELAY Unit stop work + delay(500); +} +``` + ### 2. UIFlow +*特定のルーチンについてはここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/RELAY/UIFlow).* + + + ## 回路図 @@ -35,8 +63,8 @@ ### ピンマップ - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
RELAY Unit RELAY Pin5VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
RELAY Unit リレー制御ピン5VGND
## 関連リンク diff --git a/docs/ja/unit/rgb.md b/docs/ja/unit/rgb.md index ba947d82..df352ae3 100644 --- a/docs/ja/unit/rgb.md +++ b/docs/ja/unit/rgb.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-Mini-RGB-Unit-with-NeoPixel-RGB-LED-Light-x3-GPIO-GROVE-Connector/3226069_32929809133.html?spm=a2g1y.12024536.productList_5885013.subject_21)** +:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**      🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-Mini-RGB-Unit-with-NeoPixel-RGB-LED-Light-x3-GPIO-GROVE-Connector/3226069_32929809133.html?spm=a2g1y.12024536.productList_5885013.subject_21)** + + ## 概要 @@ -13,23 +15,54 @@ ## 特徴 - 3x フルカラーLED +- サポート[UiFlow](http://flow.m5stack.com)プログラミング, [Arduino](http://www.arduino.cc)プログラミング - LEGO 互換ホール ## サンプルコード ### 1. Arduino IDE -### 2. UIFlow +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/RGB/Arduino).* -## 回路図 +```arduino +/* + Install the AdaFruit NeoPixel library first + */ +#include - +#define RGB_PIN 26 +#define NUMPIXELS 3 + +// new a object +Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB+NEO_KHZ800); + +int delayval = 150;// delay for half a second + +// initialization +pixels.begin(); // This initializes the NeoPixel library. + +// display rgb +pixels.setPixelColor(0, pixels.Color(100,0,0));//parameter = (rgb index, color) +pixels.setPixelColor(1, pixels.Color(0,100,0)); +pixels.setPixelColor(2, pixels.Color(0,0,100)); +pixels.show(); // This sends the updated pixel color to the hardware. +``` + + + + ### ピンマップ - - + +
M5Core(GROVE B)GPIO36GPIO265VGND
RGB UnitGPIO36GPIO265VGND
M5Core(GROVEインターフェースB)GPIO36GPIO265VGND
RGB Unit 信号ピン5VGND
## 関連リンク diff --git a/docs/ja/unit/thermal.md b/docs/ja/unit/thermal.md index 33aee4c3..9c82a914 100644 --- a/docs/ja/unit/thermal.md +++ b/docs/ja/unit/thermal.md @@ -4,7 +4,9 @@ *** -:memo:**[概要](#概要)**      :octocat:**[サンプルコード](#サンプルコード)**       :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-New-Thermal-Camera-MLX90640-with-GROVE-I2C-Compatible-M5GO-FIRE-ESP32-Kit-Mini-Development/3226069_32918177644.html?spm=2114.12010615.8148356.2.4ad0717733LM7H)** +:memo:**[概要](#概要)**      :electric_plug:**[回路図](#回路図)**       🛒**[購入リンク](https://www.aliexpress.com/store/product/M5Stack-Official-New-Thermal-Camera-MLX90640-with-GROVE-I2C-Compatible-M5GO-FIRE-ESP32-Kit-Mini-Development/3226069_32918177644.html?spm=2114.12010615.8148356.2.4ad0717733LM7H)** + + ## 概要 @@ -24,21 +26,21 @@ - サーモグラフィ - ビルのスマート空調システム -## サンプルコード + ## 回路図 - + ### ピンマップ - - + +
M5Core(GROVE A)GPIO22GPIO215VGND
JOYSTICK UnitSCLSDA5VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
THERMAL UnitSCLSDA5VGND
## 関連リンク diff --git a/docs/ja/unit/tof.md b/docs/ja/unit/tof.md index 2d77026f..789c257a 100644 --- a/docs/ja/unit/tof.md +++ b/docs/ja/unit/tof.md @@ -30,7 +30,37 @@ ### 1. Arduino IDE -### 2. UIFlow +*以下のコードは不完全です(説明のためだけに). 完全なコードが必要な場合は、ここをクリックしてください[サンプルコード](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/TOF/Arduino).* + +```arduino +#include +#include + +#define ToF_ADDR 0x29//the iic address of tof + +#define SYSRANGE_START 0x00 +#define RESULT_RANGE_STATUS 0x14 +#define ToF_ADDR 0x29 //the IIC address of ToF + +// declaration +uint16_t dist=0; + +// initialization +M5.begin(); +Wire.begin();// join i2c bus (address optional for master) + +// read data +write_byte_data_at(VL53L0X_REG_SYSRANGE_START, 0x01); +read_block_data_at(VL53L0X_REG_RESULT_RANGE_STATUS, 12);//read 12 bytes once +// get distance +dist = makeuint16(gbuf[11], gbuf[10]);//split distance data to variable "dist" +``` + + ## 回路図 @@ -39,7 +69,7 @@ ### ピンマップ - +
M5Core(GROVE A)GPIO22GPIO215VGND
M5Core(GROVEインターフェースA)GPIO22GPIO215VGND
TOF UnitSCLSDA5VGND
diff --git a/docs/zh_CN/base/btc_base.md b/docs/zh_CN/base/btc_base.md index cd2bcd3c..4f3b6c1b 100644 --- a/docs/zh_CN/base/btc_base.md +++ b/docs/zh_CN/base/btc_base.md @@ -1,6 +1,6 @@ # BTC底座 - + @@ -25,16 +25,16 @@ BTC模块是一款包含DHT12(温湿度)传感器的底座。有了BTC底座之 - M3 x 16 - Tools + + # 管脚映射 **DHT12** -| DHT12 | ESP32 | -| :----------: |:------------:| -| SCL | G22 | -| GND | GND | -| SDA | G21 | -| 3V3 | 3V3 | + + + +
ESP32 ChipGPIO22GNDGPIO213V3
DHT12SCLGNDSDA3V3
@@ -48,6 +48,8 @@ BTC模块是一款包含DHT12(温湿度)传感器的底座。有了BTC底座之 ### Arduino IDE +*具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino)。* + ```arduino #include #include "DHT12.h" @@ -73,5 +75,3 @@ void loop() { delay(100); } ``` - -具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino)。 diff --git a/docs/zh_CN/base/node_base.md b/docs/zh_CN/base/node_base.md index f4601470..17c89e2c 100644 --- a/docs/zh_CN/base/node_base.md +++ b/docs/zh_CN/base/node_base.md @@ -1,10 +1,10 @@ # Node - + *** -:memo:**[描述](#描述)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)** +:memo:**[描述](#描述)**      :octocat:**[Example](https://github.com/m5stack/M5StackModule-Node/tree/master/example)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.16.6c2275f4nUJEfh&id=581064610318)** @@ -31,6 +31,7 @@ - 4x 螺丝 - 1x Type-C USB线 + ## 应用 @@ -44,4 +45,4 @@ - **[官方论坛](http://forum.m5stack.com/)** -- **数据手册** - [WM8978](http://pdf1.alldatasheet.com/datasheet-pdf/view/96647/WOLFSON/WM8978.html) (WM8978) +- **数据手册** - [WM8978](http://pdf1.alldatasheet.com/datasheet-pdf/view/96647/WOLFSON/WM8978.html) diff --git a/docs/zh_CN/module/lego_plus.md b/docs/zh_CN/module/lego_plus.md index 4a10b256..70c04e7b 100644 --- a/docs/zh_CN/module/lego_plus.md +++ b/docs/zh_CN/module/lego_plus.md @@ -39,8 +39,8 @@ ### 2. UIFlow +*具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LEGO_PLUS/UIFlow)。* + -具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LEGO_PLUS/UIFlow)。 - diff --git a/docs/zh_CN/module/lora.md b/docs/zh_CN/module/lora.md index 89337b16..e4ae1699 100644 --- a/docs/zh_CN/module/lora.md +++ b/docs/zh_CN/module/lora.md @@ -4,7 +4,9 @@ *** -:memo:**[描述](#描述)**      :octocat:**[例程](#例程)**      :electric_plug:**[原理图](#原理图)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.70.6c2275f4nUJEfh&id=559302217850)** +:memo:**[描述](#描述)**      🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.5-c.w4002-1172588093.70.6c2275f4nUJEfh&id=559302217850)** + + ## 描述 @@ -45,9 +47,9 @@ M5Stack LoRa模块适用于长距离通信,结合多个LoRa模块,能组成 m5.begin(); ``` -## 例程 + diff --git a/docs/zh_CN/module/sim800.md b/docs/zh_CN/module/sim800.md index b77f1a3b..21391000 100644 --- a/docs/zh_CN/module/sim800.md +++ b/docs/zh_CN/module/sim800.md @@ -50,7 +50,7 @@ SIM800L是完整的支持四种频宽的GSM/GPRS解决方案。通过串口发 - **[官方论坛](http://forum.m5stack.com/)** -- **[SIM800L信息](http://simcomm2m.com/En/module/detail.aspx?id=138)** (SIM800L) + diff --git a/docs/zh_CN/quick_start/bala/bala_quick_start.md b/docs/zh_CN/quick_start/bala/bala_quick_start.md index 942a2e27..f76aa693 100644 --- a/docs/zh_CN/quick_start/bala/bala_quick_start.md +++ b/docs/zh_CN/quick_start/bala/bala_quick_start.md @@ -1,7 +1,5 @@ # BALA 上手指南 -中文 | [English](en/quick_start/bala/bala_quick_start) | [日本語](ja/quick_start/bala/bala_quick_start) - !>为了使用M5Bala,需要M5Stack FIRE或M5GO(白色)。 ## 准备 @@ -17,7 +15,7 @@ 1. 烧录UiFlow的固件 - [如何通过M5Burner烧录固件](/zh_CN/related_documents/how_to_burn_firmware) 2. WiFi链接 - [如何使用M5Core连接可联网的WiFi热点](/zh_CN/related_documents/how_to_connect_wifi_using_core) -3. 检查弹簧针的位置,并将M5Core堆叠在M5Bala上 +3. 检查弹簧针POGO Pin的位置,并将M5Core堆叠在M5Bala上
@@ -82,19 +80,9 @@ while True: ## Arduino IDE编辑 -1. 安装Arduino IDE -2. 在Arduino IDE的设置board manager附加网址加`https://dl.espressif.com/dl/package_esp32_index.json` -
- -
-
- -
+1. 搭建M5Stack的Arduino IDE开发环境 - [搭建M5Stack的开发环境](/zh_CN/related_documents/establish_serial_connection) -1. 在Arduino IDE的板管理安装`esp32`库 -
- -
+ 1. 在Arduino IDE的库管理安装`m5stack`库
diff --git a/docs/zh_CN/unit/adc.md b/docs/zh_CN/unit/adc.md index 6f3e6823..94a4549b 100644 --- a/docs/zh_CN/unit/adc.md +++ b/docs/zh_CN/unit/adc.md @@ -17,7 +17,7 @@ - ADC有16位分辨率,可以设置每秒采样8、16、32、128次以进行A/D转换 - ADC芯片内部可以产生高达8倍的放大,从而可以采集幅值更小的模拟信号 - 能测量0~12V的电压输入 -- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 + - Unit内置两个Lego插件孔,方便与Lego件结合 ## 应用 diff --git a/docs/zh_CN/unit/angle.md b/docs/zh_CN/unit/angle.md index 32a6bcd3..f742f7d4 100644 --- a/docs/zh_CN/unit/angle.md +++ b/docs/zh_CN/unit/angle.md @@ -48,9 +48,9 @@ cur_sensorValue = analogRead(sensorPin); ### 2. UIFlow - +*具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ANGLE/UIFlow)。* -具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ANGLE/UIFlow)。 + diff --git a/docs/zh_CN/unit/dac.md b/docs/zh_CN/unit/dac.md index 0ad6b5ca..d428ede9 100644 --- a/docs/zh_CN/unit/dac.md +++ b/docs/zh_CN/unit/dac.md @@ -16,7 +16,7 @@ - 高达12位的转换精度 - 0~3.3V幅度的电压输出 -- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 + - Unit内置两个Lego插件孔,方便与Lego件结合 ## 应用 diff --git a/docs/zh_CN/unit/env.md b/docs/zh_CN/unit/env.md index 239ad170..0c61aea7 100644 --- a/docs/zh_CN/unit/env.md +++ b/docs/zh_CN/unit/env.md @@ -89,9 +89,9 @@ void loop() { ### 2. UIFlow - +*具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ENV/UIFlow)。* -具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ENV/UIFlow)。 + ## 原理图 diff --git a/docs/zh_CN/unit/ir.md b/docs/zh_CN/unit/ir.md index f815f0ae..5206b027 100644 --- a/docs/zh_CN/unit/ir.md +++ b/docs/zh_CN/unit/ir.md @@ -49,9 +49,9 @@ cur_recv_value = digitalRead(ir_recv_pin);// read the status of receiver ### 2. UIFlow - +*具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/IR/UIFlow)。* -具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/IR/UIFlow)。 + ## 原理图 diff --git a/docs/zh_CN/unit/pir.md b/docs/zh_CN/unit/pir.md index d6ee263f..f05c5b03 100644 --- a/docs/zh_CN/unit/pir.md +++ b/docs/zh_CN/unit/pir.md @@ -45,9 +45,9 @@ M5.update(); ### 2. UIFlow - +*具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/PIR/UIFlow)。* -具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/PIR/UIFlow)。 + ## 原理图 diff --git a/docs/zh_CN/unit/relay.md b/docs/zh_CN/unit/relay.md index 623f56a2..668b0221 100644 --- a/docs/zh_CN/unit/relay.md +++ b/docs/zh_CN/unit/relay.md @@ -62,7 +62,7 @@ void loop(void) { ### 管脚映射 - +
M5Core(GROVE B)GPIO36GPIO265VGND
M5Core(GROVE接口B)GPIO36GPIO265VGND
RELAY继电器Unit 继电器控制引脚5VGND
diff --git a/docs/zh_CN/unit/thermal.md b/docs/zh_CN/unit/thermal.md index 8b7f8207..14805812 100644 --- a/docs/zh_CN/unit/thermal.md +++ b/docs/zh_CN/unit/thermal.md @@ -21,7 +21,7 @@ - 32x24像素 - 目标温度:-40°C ~ 300°C -- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 + - Unit内置两个Lego插件孔,方便与Lego件结合 ## 应用 diff --git a/docs/zh_CN/unit/tof.md b/docs/zh_CN/unit/tof.md index 32ac14ab..fbd348f3 100644 --- a/docs/zh_CN/unit/tof.md +++ b/docs/zh_CN/unit/tof.md @@ -17,7 +17,7 @@ - 高精度 - 测量距离最大2m - 激光波长: 940nm -- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 + - Unit内置两个Lego插件孔,方便与Lego件结合 ## 应用