mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
updated
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Unit CarKB - QWERTY键盘 {docsify-ignore-all}
|
||||
# Unit CarKB {docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_cardkb_01.png" width="30%" height="30%"><img src="assets/img/product_pics/unit/unit_cardkb_grove_a.png" width="30%" height="30%">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# CATEAR - 猫耳朵 {docsify-ignore-all}
|
||||
# Unit CATEAR{docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_catear_01.png" width="30%" height="30%"><img src="assets/img/product_pics/unit/unit_catear_02.png" width="30%" height="30%"><img src="assets/img/product_pics/unit/unit_catear_03.png" width="30%" height="30%">
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# COLOR - 颜色传感器 Unit {docsify-ignore-all}
|
||||
# Unit COLOR {docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/unit/M5GO_Unit_color.png" width="30%" height="30%"><img src="assets/img/product_pics/unit/unit_color_grove_a.png" width="30%" height="30%">
|
||||
|
||||
@@ -93,34 +93,12 @@ tcs.setGain(TCS34725_GAIN_4X);
|
||||
tcs.getRawData(&red, &green, &blue, &clear);
|
||||
```
|
||||
|
||||
<!-- // 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;
|
||||
}
|
||||
|
||||
// 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); -->
|
||||
|
||||
烧录了例程后,串口显示终端会打印原始值,包括明光感应值(Clear)、红、绿、蓝(RGB)
|
||||
|
||||
下图是感应红色的输出结果
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/COLOR/example_unit_color_result_01.png">
|
||||
|
||||
<!-- ### 2. UIFlow -->
|
||||
<!--
|
||||
<img src="assets/img/product_pics/unit/unit_example/example_unit_color_01.png" width="30%" height="30%"> <img src="assets/img/product_pics/unit/unit_example/example_unit_color_02.png" width="55%" height="55%">
|
||||
|
||||
具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/COLOR/UIFlow)。 -->
|
||||
|
||||
## 原理图
|
||||
|
||||
<img src="assets/img/product_pics/unit/color_sch.JPG">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# EXT.IO - IO拓展Unit {docsify-ignore-all}
|
||||
# Unit EXT.IO {docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_extio_01.png" width="30%" height="30%"><img src="assets/img/product_pics/unit/unit_extio_02.png" width="30%" height="30%">
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
:memo:**[描述](#描述)** :octocat:**[例程](#例程)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.15.3b86425eaoE9zU&id=585289717492)**
|
||||
|
||||
<!-- :memo:**[描述](#描述)** :octocat:**[例程](#例程)** :electric_plug:**[原理图](#原理图)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.15.3b86425eaoE9zU&id=585289717492)** :clapper:**[相关视频](#相关视频)** -->
|
||||
|
||||
## 描述
|
||||
|
||||
**<mark>EXT.IO</mark>**是用来拓展IO引脚的Unit,集成了IO拓展芯片PCA9554PW,实现两位的IIC串口引脚控制8位并口状态,实现8位并口的输入或者输出模式。在IO口紧缺的项目中,接上这个Unit可以实现由2个引脚变成8个可以独立控制的引脚。
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
:memo:**[描述](#描述)** :octocat:**[例程](#例程)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.11.729b425eylCryH&id=583461942661)**
|
||||
|
||||
<!-- :memo:**[描述](#描述)** :octocat:**[例程](#例程)** :electric_plug:**[原理图](#原理图)** 🛒**[购买链接](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.11.729b425eylCryH&id=583461942661)** :clapper:**[相关视频](#相关视频)** -->
|
||||
|
||||
## 描述
|
||||
|
||||
**<mark>HEX</mark>**是一个六边形的RGB LED unit。一共有37颗LED,而多个HEX可以通过输入输出口串联一起。
|
||||
|
||||
Reference in New Issue
Block a user