mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
add btc
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
# M5Stack BTC Module
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_03.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%">
|
||||
|
||||
<!-- <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%"> -->
|
||||
|
||||
***
|
||||
|
||||
:memo:**[Description](#Description)** :octocat:**[Example](#Example)** 🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-Official-Stock-Offer-GPS-Module-with-Internal-External-Antenna-MCX-Interface-IoT-Development-Board-for/3226069_32840757048.html?spm=2114.12010615.8148356.2.7c6c2743BZthY3)**
|
||||
|
||||
<!-- :memo:**[Description](#Description)** :octocat:**[Example](#Example)** :electric_plug:**[Schematic](#Schematic)** 🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-Official-Stock-Offer-GPS-Module-with-Internal-External-Antenna-MCX-Interface-IoT-Development-Board-for/3226069_32840757048.html?spm=2114.12010615.8148356.2.7c6c2743BZthY3)** -->
|
||||
|
||||
# Description
|
||||
|
||||
The M5Stack BTC Module 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
|
||||
Core via Type-C Cable after adding this BTC Module.
|
||||
|
||||
# Feature
|
||||
|
||||
- DHT12 inside
|
||||
|
||||
# Include
|
||||
|
||||
- Type-C USB Cable
|
||||
- M3 x 16
|
||||
- Tools
|
||||
|
||||
# PinMap
|
||||
|
||||
**DHT12**
|
||||
|
||||
| DHT12 | ESP32 |
|
||||
| :----------: |:------------:|
|
||||
| SCL | G22 |
|
||||
| GND | GND |
|
||||
| SDA | G21 |
|
||||
| 3V3 | 3V3 |
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_dht12_pinmap.png">
|
||||
|
||||
|
||||
# Related Link
|
||||
|
||||
- **[Offical Video](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)**
|
||||
|
||||
- **[Forum](http://forum.m5stack.com/)**
|
||||
|
||||
## Example
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
#include "DHT12.h"
|
||||
#include <Wire.h> //The DHT12 uses I2C comunication.
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
Wire.begin();
|
||||
M5.Lcd.setBrightness(10);
|
||||
Serial.println(F("ENV Unit(DHT12 and BMP280) test..."));
|
||||
}
|
||||
|
||||
void loop() {
|
||||
float tmp = dht12.readTemperature();
|
||||
float hum = dht12.readHumidity();
|
||||
Serial.printf("Temperatura: %2.2f*C Humedad: %0.2f%%\r\n", tmp, hum);
|
||||
|
||||
M5.Lcd.setCursor(0, 0);
|
||||
M5.Lcd.setTextColor(WHITE, BLACK);
|
||||
M5.Lcd.setTextSize(3);
|
||||
M5.Lcd.printf("Temp: %2.1f \r\nHumi: %2.0f%% \r\n", tmp, hum);
|
||||
|
||||
delay(100);
|
||||
}
|
||||
```
|
||||
|
||||
For specific example `BTC.ino`, click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino) please.
|
||||
@@ -1,48 +0,0 @@
|
||||
# M5Stack BTC Module
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_03.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%">
|
||||
|
||||
<!-- <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%"> -->
|
||||
|
||||
***
|
||||
|
||||
:memo:**[Description](#Description)** :octocat:**[Example](#Example)** :electric_plug:**[Schematic](#Schematic)** 🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-Official-Stock-Offer-GPS-Module-with-Internal-External-Antenna-MCX-Interface-IoT-Development-Board-for/3226069_32840757048.html?spm=2114.12010615.8148356.2.7c6c2743BZthY3)**
|
||||
|
||||
# Description
|
||||
|
||||
The M5Stack BTC Module 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
|
||||
Core via Type-C Cable after adding this BTC Module.
|
||||
|
||||
# Feature
|
||||
|
||||
- DHT12 inside
|
||||
|
||||
# Include
|
||||
|
||||
- Type-C USB Cable
|
||||
- M3 x 16
|
||||
- Tools
|
||||
|
||||
# PinMap
|
||||
|
||||
**DHT12**
|
||||
|
||||
| DHT12 | ESP32 |
|
||||
| :----------: |:------------:|
|
||||
| SCL | G22 |
|
||||
| GND | GND |
|
||||
| SDA | G21 |
|
||||
| 3V3 | 3V3 |
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_dht12_pinmap.png">
|
||||
|
||||
|
||||
# Related Link
|
||||
|
||||
- **[Offical Video](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)**
|
||||
|
||||
- **[Forum](http://forum.m5stack.com/)**
|
||||
|
||||
+28
-16
@@ -25,32 +25,44 @@ The Unit BUTTON is a sigle-button unit that can be detected whether the button p
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
|
||||
int last_value = 0;
|
||||
int cur_value = 0;
|
||||
|
||||
void setup() {
|
||||
// init lcd
|
||||
M5.begin();
|
||||
M5.begin();// init
|
||||
Serial.begin(115200);
|
||||
pinMode(36, INPUT);
|
||||
M5.Lcd.clear(BLACK);
|
||||
M5.Lcd.setTextColor(YELLOW);
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.setCursor(65, 10);
|
||||
M5.Lcd.println("Button example");
|
||||
M5.Lcd.setTextColor(RED);
|
||||
M5.Lcd.setCursor(80, 0); M5.Lcd.println("Button example");
|
||||
Serial.println("Button example: ");
|
||||
M5.Lcd.setTextColor(WHITE);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
M5.update();
|
||||
|
||||
if(digitalRead(36)==0)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
if(digitalRead(36)==1)
|
||||
{
|
||||
M5.Lcd.print("1");
|
||||
break;
|
||||
}
|
||||
cur_value = digitalRead(36);// read the value of BUTTON
|
||||
M5.Lcd.setCursor(0,25); M5.Lcd.print("Status: ");
|
||||
M5.Lcd.setCursor(0,45); M5.Lcd.print("Value: ");
|
||||
if(cur_value != last_value){
|
||||
M5.Lcd.fillRect(95,25,100,25,BLACK);
|
||||
M5.Lcd.fillRect(95,45,100,25,BLACK);
|
||||
if(cur_value==0){
|
||||
M5.Lcd.setCursor(95,25); M5.Lcd.print("pressed");// display the status
|
||||
M5.Lcd.setCursor(95,45); M5.Lcd.print("0");
|
||||
Serial.println("Button Status: pressed");
|
||||
Serial.println(" value: 0");
|
||||
}
|
||||
else{
|
||||
M5.Lcd.setCursor(95,25); M5.Lcd.print("released");// display the status
|
||||
M5.Lcd.setCursor(95,45); M5.Lcd.print("1");
|
||||
Serial.println("Button Status: released");
|
||||
Serial.println(" value: 1");
|
||||
}
|
||||
last_value = cur_value;
|
||||
}
|
||||
M5.update();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@
|
||||
|
||||
<img src='assets/img/product_pics/5.jpg'> <img src='assets/img/product_pics/bases.png'>
|
||||
|
||||
[](en/base/lan_base) [](en/base/node_base)
|
||||
[](en/base/lan_base) [](en/base/node_base) [](en/base/btc_base)
|
||||
|
||||
<!-- [](en/base/plc_base) -->
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<img src='assets/img/product_pics/5.jpg'> <img src='assets/img/product_pics/bases.png'>
|
||||
|
||||
[](zh_CN/base/lan_base) [](zh_CN/base/node_base)
|
||||
[](zh_CN/base/lan_base) [](zh_CN/base/node_base) [](zh_CN/base/btc_base)
|
||||
|
||||
<!-- [](zh_CN/base/plc_base) -->
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
<!-- [](zh_CN/unit/rgb) [](zh_CN/unit/relay) [](zh_CN/unit/neopixel) -->
|
||||
|
||||
[](zh_CN/unit/hub) [](zh_CN/unit/396port) [](zh_CN/unit/proto)
|
||||
[](zh_CN/unit/hub)[](zh_CN/unit/396port)[](zh_CN/unit/proto)
|
||||
|
||||
<!-- [](zh_CN/unit/hub) [](zh_CN/unit/396port)
|
||||
[](zh_CN/unit/proto) -->
|
||||
|
||||
@@ -1,55 +1,77 @@
|
||||
# BTC底座
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_03.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%">
|
||||
|
||||
<!-- <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%"> -->
|
||||
|
||||
***
|
||||
|
||||
:memo:**[描述](#描述)** :octocat:**[例程](#例程)** :electric_plug:**[原理图](#原理图)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.69f6425e8Agsbh&id=559647865340)**
|
||||
|
||||
# 描述
|
||||
|
||||
BTC模块是一款包含DHT12(温湿度)传感器的底座。有了BTC底座之后,可以方便给M5Core充电。
|
||||
|
||||
# 特性
|
||||
|
||||
- 内置DHT12
|
||||
|
||||
# 包含
|
||||
|
||||
- Type-C USB线
|
||||
- M3 x 16
|
||||
- Tools
|
||||
|
||||
# 管脚映射
|
||||
|
||||
**DHT12**
|
||||
|
||||
| DHT12 | ESP32 |
|
||||
| :----------: |:------------:|
|
||||
| SCL | G22 |
|
||||
| GND | GND |
|
||||
| SDA | G21 |
|
||||
| 3V3 | 3V3 |
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_dht12_pinmap.png">
|
||||
|
||||
## 相关链接
|
||||
|
||||
- **[官方频道视频](https://i.youku.com/i/UNjE1ODA2MzE0OA==?spm=a2hzp.8253869.0.0)**
|
||||
|
||||
- **[官方论坛](http://forum.m5stack.com/)**
|
||||
|
||||
## 例程
|
||||
|
||||
### 1. Arduino IDE
|
||||
|
||||
```arduino
|
||||
float tmp = dht12.readTemperature();//temperature
|
||||
float hum = dht12.readHumidity();//humidity
|
||||
```
|
||||
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ENV/Arduino)。
|
||||
|
||||
## 原理图
|
||||
# BTC底座
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_02.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_03.png" width="30%" height="30%"> <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%">
|
||||
|
||||
<!-- <img src="assets/img/product_pics/module/module_btc_04.png" width="30%" height="30%"> -->
|
||||
|
||||
***
|
||||
|
||||
:memo:**[描述](#描述)** :octocat:**[例程](#例程)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.69f6425e8Agsbh&id=559647865340)**
|
||||
|
||||
<!-- :memo:**[描述](#描述)** :octocat:**[例程](#例程)** :electric_plug:**[原理图](#原理图)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.10.69f6425e8Agsbh&id=559647865340)** -->
|
||||
|
||||
|
||||
# 描述
|
||||
|
||||
BTC模块是一款包含DHT12(温湿度)传感器的底座。有了BTC底座之后,可以方便给M5Core充电。
|
||||
|
||||
# 特性
|
||||
|
||||
- 内置DHT12
|
||||
|
||||
# 包含
|
||||
|
||||
- Type-C USB线
|
||||
- M3 x 16
|
||||
- Tools
|
||||
|
||||
# 管脚映射
|
||||
|
||||
**DHT12**
|
||||
|
||||
| DHT12 | ESP32 |
|
||||
| :----------: |:------------:|
|
||||
| SCL | G22 |
|
||||
| GND | GND |
|
||||
| SDA | G21 |
|
||||
| 3V3 | 3V3 |
|
||||
|
||||
<img src="assets/img/product_pics/module/module_btc_dht12_pinmap.png">
|
||||
|
||||
## 相关链接
|
||||
|
||||
- **[官方频道视频](https://i.youku.com/i/UNjE1ODA2MzE0OA==?spm=a2hzp.8253869.0.0)**
|
||||
|
||||
- **[官方论坛](http://forum.m5stack.com/)**
|
||||
|
||||
## 例程
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
#include "DHT12.h"
|
||||
#include <Wire.h> //The DHT12 uses I2C comunication.
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
Wire.begin();
|
||||
M5.Lcd.setBrightness(10);
|
||||
Serial.println(F("ENV Unit(DHT12 and BMP280) test..."));
|
||||
}
|
||||
|
||||
void loop() {
|
||||
float tmp = dht12.readTemperature();
|
||||
float hum = dht12.readHumidity();
|
||||
Serial.printf("Temperatura: %2.2f*C Humedad: %0.2f%%\r\n", tmp, hum);
|
||||
|
||||
M5.Lcd.setCursor(0, 0);
|
||||
M5.Lcd.setTextColor(WHITE, BLACK);
|
||||
M5.Lcd.setTextSize(3);
|
||||
M5.Lcd.printf("Temp: %2.1f \r\nHumi: %2.0f%% \r\n", tmp, hum);
|
||||
|
||||
delay(100);
|
||||
}
|
||||
```
|
||||
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Base/BTC/Arduino)。
|
||||
@@ -23,15 +23,49 @@ BUTTON是一个单按键unit,这个Unit能检测你是否按下了.
|
||||
|
||||
## 例程
|
||||
|
||||
<!-- ### 1. Arduino IDE
|
||||
### 1. Arduino IDE
|
||||
|
||||
```arduino
|
||||
DHT12 dht12; //new a object
|
||||
Adafruit_BMP280 bme;
|
||||
#include <M5Stack.h>
|
||||
|
||||
float tmp = dht12.readTemperature();//temperature
|
||||
float hum = dht12.readHumidity();//humidity
|
||||
float pressure = bme.readPressure();//pressure
|
||||
int last_value = 0;
|
||||
int cur_value = 0;
|
||||
|
||||
void setup() {
|
||||
M5.begin();// init
|
||||
Serial.begin(115200);
|
||||
pinMode(36, INPUT);
|
||||
M5.Lcd.clear(BLACK);
|
||||
M5.Lcd.setTextColor(YELLOW);
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.setCursor(80, 0); M5.Lcd.println("Button example");
|
||||
Serial.println("Button example: ");
|
||||
M5.Lcd.setTextColor(WHITE);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
cur_value = digitalRead(36);// read the value of BUTTON
|
||||
M5.Lcd.setCursor(0,25); M5.Lcd.print("Status: ");
|
||||
M5.Lcd.setCursor(0,45); M5.Lcd.print("Value: ");
|
||||
if(cur_value != last_value){
|
||||
M5.Lcd.fillRect(95,25,100,25,BLACK);
|
||||
M5.Lcd.fillRect(95,45,100,25,BLACK);
|
||||
if(cur_value==0){
|
||||
M5.Lcd.setCursor(95,25); M5.Lcd.print("pressed");// display the status
|
||||
M5.Lcd.setCursor(95,45); M5.Lcd.print("0");
|
||||
Serial.println("Button Status: pressed");
|
||||
Serial.println(" value: 0");
|
||||
}
|
||||
else{
|
||||
M5.Lcd.setCursor(95,25); M5.Lcd.print("released");// display the status
|
||||
M5.Lcd.setCursor(95,45); M5.Lcd.print("1");
|
||||
Serial.println("Button Status: released");
|
||||
Serial.println(" value: 1");
|
||||
}
|
||||
last_value = cur_value;
|
||||
}
|
||||
M5.update();
|
||||
}
|
||||
```
|
||||
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/BUTTON/Arduino)。
|
||||
@@ -40,7 +74,7 @@ float pressure = bme.readPressure();//pressure
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/example_unit_button_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/unit/unit_example/example_unit_button_02.png" width="55%" height="55%">
|
||||
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/BUTTON/UIFlow)。 -->
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/BUTTON/UIFlow)。
|
||||
|
||||
## 原理图
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
## 例程
|
||||
|
||||
<!-- ### 1. Arduino IDE
|
||||
### 1. Arduino IDE
|
||||
|
||||
```arduino
|
||||
DHT12 dht12; //new a object
|
||||
@@ -38,9 +38,9 @@ float pressure = bme.readPressure();//pressure
|
||||
|
||||
### 2. UIFlow
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/example_unit_dual_button_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/unit/unit_example/example_unit_dual_button_02.png" width="55%" height="55%">
|
||||
<img src="assets/img/product_pics/unit/unit_example/DUAL_BUTTON/1.png" width="30%" height="30%"> <img src="assets/img/product_pics/unit/unit_example/DUAL_BUTTON/2.png" width="55%" height="55%"><img src="assets/img/product_pics/unit/unit_example/DUAL_BUTTON/3.png" width="55%" height="55%"><img src="assets/img/product_pics/unit/unit_example/DUAL_BUTTON/4.png" width="55%" height="55%">
|
||||
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/DUAL_BUTTON/UIFlow)。 -->
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/DUAL_BUTTON/UIFlow)。
|
||||
|
||||
## 原理图
|
||||
|
||||
|
||||
Reference in New Issue
Block a user