This commit is contained in:
LiHuashen
2018-12-26 17:45:34 +08:00
parent 777c3a97ce
commit b75cf864f2
8 changed files with 233 additions and 132 deletions
+81
View File
@@ -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)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:octocat:**[Example](#Example)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;🛒**[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)**&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-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.
-48
View File
@@ -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)**&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-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
View File
@@ -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
View File
@@ -52,7 +52,7 @@
<img src='assets/img/product_pics/5.jpg'> <img src='assets/img/product_pics/bases.png'>
[![lan_01.png](https://i.loli.net/2018/12/13/5c1223ee16411.png)](en/base/lan_base)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![node_01.png](https://i.loli.net/2018/12/13/5c1223fd8d2cb.png)](en/base/node_base)
[![lan_01.png](https://i.loli.net/2018/12/13/5c1223ee16411.png)](en/base/lan_base)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![node_01.png](https://i.loli.net/2018/12/13/5c1223fd8d2cb.png)](en/base/node_base)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![btc_01.png](https://i.loli.net/2018/12/13/5c122411a87d1.png)](en/base/btc_base)
<!-- [![plc_01.png](https://i.loli.net/2018/12/13/5c122411a87d1.png)](en/base/plc_base) -->
+2 -2
View File
@@ -46,7 +46,7 @@
<img src='assets/img/product_pics/5.jpg'> <img src='assets/img/product_pics/bases.png'>
[![lan_01.png](https://i.loli.net/2018/12/13/5c1223ee16411.png)](zh_CN/base/lan_base) [![node_01.png](https://i.loli.net/2018/12/13/5c1223fd8d2cb.png)](zh_CN/base/node_base)
[![lan_01.png](https://i.loli.net/2018/12/13/5c1223ee16411.png)](zh_CN/base/lan_base)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![node_01.png](https://i.loli.net/2018/12/13/5c1223fd8d2cb.png)](zh_CN/base/node_base)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![btc_01.png](https://i.loli.net/2018/12/13/5c122411a87d1.png)](zh_CN/base/btc_base)
<!-- [![plc_01.png](https://i.loli.net/2018/12/13/5c122411a87d1.png)](zh_CN/base/plc_base) -->
@@ -88,7 +88,7 @@
<!-- [![M5GO_Unit_rgb.png](https://i.loli.net/2018/12/13/5c121f5c98542.png)](zh_CN/unit/rgb)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![M5GO_Unit_relay.png](https://i.loli.net/2018/12/13/5c121f6e9a185.png)](zh_CN/unit/relay)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![M5GO_Unit_neopixel.png](https://i.loli.net/2018/12/13/5c121f8457fcb.png)](zh_CN/unit/neopixel) -->
[![unit_hub.png](https://img-blog.csdnimg.cn/20181211174142806.png)](zh_CN/unit/hub)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![unit_396port.png](https://img-blog.csdnimg.cn/20181211174154240.png)](zh_CN/unit/396port)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![unit_proto.png](https://img-blog.csdnimg.cn/20181211175313832.png)](zh_CN/unit/proto)
[![unit_hub.png](https://img-blog.csdnimg.cn/20181211174142806.png)](zh_CN/unit/hub)[![unit_396port.png](https://img-blog.csdnimg.cn/20181211174154240.png)](zh_CN/unit/396port)[![unit_proto.png](https://img-blog.csdnimg.cn/20181211175313832.png)](zh_CN/unit/proto)
<!-- [![unit_hub.png](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/docs/assets/img/product_pics/pictures_for_homepage/units/unit_hub.png)](zh_CN/unit/hub)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![unit_3.96.png](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/docs/assets/img/product_pics/pictures_for_homepage/units/unit_396port.png)](zh_CN/unit/396port)
[![unit_proto.png](http://m5-docs.oss-cn-shenzhen.aliyuncs.com/docs/assets/img/product_pics/pictures_for_homepage/units/unit_proto.png)](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:**[描述](#描述)**&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.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:**[描述](#描述)**&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.69f6425e8Agsbh&id=559647865340)**
<!-- :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.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)。
+41 -7
View File
@@ -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)。
## 原理图
+3 -3
View File
@@ -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)。
## 原理图