diff --git a/docs/assets/img/product_pics/unit/camera_comparison.png b/docs/assets/img/product_pics/unit/camera_comparison.png index 9132df15..7969918a 100644 Binary files a/docs/assets/img/product_pics/unit/camera_comparison.png and b/docs/assets/img/product_pics/unit/camera_comparison.png differ diff --git a/docs/assets/img/product_pics/unit/camera_comparison_ja.png b/docs/assets/img/product_pics/unit/camera_comparison_ja.png index ba7ed2bc..7e238180 100644 Binary files a/docs/assets/img/product_pics/unit/camera_comparison_ja.png and b/docs/assets/img/product_pics/unit/camera_comparison_ja.png differ diff --git a/docs/assets/img/product_pics/unit/camera_comparison_zh_CN.png b/docs/assets/img/product_pics/unit/camera_comparison_zh_CN.png index 7b2c1d67..767759dc 100644 Binary files a/docs/assets/img/product_pics/unit/camera_comparison_zh_CN.png and b/docs/assets/img/product_pics/unit/camera_comparison_zh_CN.png differ diff --git a/docs/assets/img/product_pics/unit/trace_sch.png b/docs/assets/img/product_pics/unit/trace_sch.png new file mode 100644 index 00000000..a65379dd Binary files /dev/null and b/docs/assets/img/product_pics/unit/trace_sch.png differ diff --git a/docs/assets/img/product_pics/unit/unit_trace_04.png b/docs/assets/img/product_pics/unit/unit_trace_04.png index 9be07bba..7b846139 100644 Binary files a/docs/assets/img/product_pics/unit/unit_trace_04.png and b/docs/assets/img/product_pics/unit/unit_trace_04.png differ diff --git a/docs/en/unit/esp32cam.md b/docs/en/unit/esp32cam.md index 10fc5f9a..b983f3d5 100644 --- a/docs/en/unit/esp32cam.md +++ b/docs/en/unit/esp32cam.md @@ -54,7 +54,6 @@ Because the module can generate WIFI hotspot AP, So you can use your mobile phon ## Include - 1x M5 Camera -- 1x Type-C USB Cable ## PinMap diff --git a/docs/en/unit/trace.md b/docs/en/unit/trace.md new file mode 100644 index 00000000..e36d33e8 --- /dev/null +++ b/docs/en/unit/trace.md @@ -0,0 +1,90 @@ +# TRACE - Line follower Unit {docsify-ignore-all} + + + +*** + +:memo:**[Description](#Description)**      :octocat:**[Example](#Example)**      :electric_plug:**[Schematic](#Schematic)**      🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-New-TRACE-Board-for-Lidar-Bot-Mini-Car-M5BALA-Balance-Car-with-MEGA328-4-IR/3226069_32974626338.html?spm=a2g1y.12024536.productList_5885013.subject_0)**      :clapper:**[Related Video](#Related-Video)** + +## Description + +**TRACE** is a line-follower unit with built-in 4 pairs of photoelectric tube and MEGA328 chip. + +TRACE Unit also communicates with the master through the IIC ( the IIC address is 0x5A). When connected to the M5Core, it is connected to the GROVE A. + + + +## Feature + +- operation range: The reflecting surface is less than 11mm from the photoelectric surface +- GROVE interface, support [UiFlow](http://flow.m5stack.com) and [Arduino](http://www.arduino.cc) + +## Related Link + +- **[Offical Video](https://www.youtube.com/channel/UCozgFVglWYQXbvTmGyS739w)** + +- **[Forum](http://forum.m5stack.com/)** + +- **[The Firmware of inside MEGA328](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/TRACE/firmware_328p)** + +## Example + +### 1. Arduino IDE + +*The below code is incomplete(just for usage). If you want the complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/TRACE/Arduino)。* + +```arduino +#include +#include "Wire.h" + +#define TRACE_ADDR 0x5a + +// declaration +#define VALUE_SPLIT +uint8_t value; +int SensorArray[4] = {0}; + +// initialization +m5.begin(); +Serial.begin(115200); +Wire.begin(); + + +// read data +Wire.beginTransmission(TRACE_ADDR); +Wire.write(0x00); +Wire.endTransmission(); +Wire.requestFrom(TRACE_ADDR,1); +while(Wire.available()){ + value = Wire.read(); +} +SensorArray[3] = (value&0x08)>>3; +SensorArray[2] = (value&0x04)>>2; +SensorArray[1] = (value&0x02)>>1; +SensorArray[0] = (value&0x01)>>0; +``` + + + +### 2. UIFlow + +*If you want the complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/TRACE/UIFlow)。* + + + +## Schematic + + + +### PinMap + + + + +
M5Core(GROVE A)GPIO22GPIO215VGND
TRACE UnitSCLSDA5VGND
+ +## Related Video + +**TRACE Case** + + \ No newline at end of file diff --git a/docs/ja/unit/esp32cam.md b/docs/ja/unit/esp32cam.md index 9c9ee7bf..de2d12aa 100644 --- a/docs/ja/unit/esp32cam.md +++ b/docs/ja/unit/esp32cam.md @@ -40,7 +40,6 @@ ## パッケージ内容 - 1x ESP32Cam -- 1x USB Type-C ケーブル ## 関連リンク diff --git a/docs/zh_CN/quick_start/m5core/m5stack_core_get_started_Arduino_MacOS.md b/docs/zh_CN/quick_start/m5core/m5stack_core_get_started_Arduino_MacOS.md index b1cf0403..1e97bcca 100644 --- a/docs/zh_CN/quick_start/m5core/m5stack_core_get_started_Arduino_MacOS.md +++ b/docs/zh_CN/quick_start/m5core/m5stack_core_get_started_Arduino_MacOS.md @@ -1,5 +1,4 @@ - {docsify-ignore-all} -# Core 上手指南(macOS, Arudino) +# Core 上手指南(macOS, Arudino) {docsify-ignore-all} diff --git a/docs/zh_CN/unit/esp32cam.md b/docs/zh_CN/unit/esp32cam.md index 15c735e3..efa29d60 100644 --- a/docs/zh_CN/unit/esp32cam.md +++ b/docs/zh_CN/unit/esp32cam.md @@ -53,7 +53,6 @@ ## 包含 - 1x ESP32Cam Unit -- 1x Type-C USB 线 ## 管脚映射 diff --git a/docs/zh_CN/unit/trace.md b/docs/zh_CN/unit/trace.md index 2893ed57..2b8c0f5b 100644 --- a/docs/zh_CN/unit/trace.md +++ b/docs/zh_CN/unit/trace.md @@ -1,6 +1,6 @@ # TRACE - 巡线 Unit {docsify-ignore-all} - + *** @@ -12,14 +12,14 @@ TRACE Unit 同样也是通过 IIC 与主控通信,其I2C地址是0x5A。与 M5Core 相连时,接在 GROVE A 口。 - + ## 特性 - 工作范围:反射面距离光电对管面小于 11mm -- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 +- GROVE接口,支持[UiFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程 ## 相关链接 @@ -27,7 +27,7 @@ TRACE Unit 同样也是通过 IIC 与主控通信,其I2C地址是0x5A。与 M5 - **[官方论坛](http://forum.m5stack.com/)** - +- **[模块内MEGA328固件](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/TRACE/firmware_328p)** ## 例程 @@ -39,43 +39,54 @@ TRACE Unit 同样也是通过 IIC 与主控通信,其I2C地址是0x5A。与 M5 #include #include "Wire.h" -#define JOY_ADDR 0x52 +#define TRACE_ADDR 0x5a // declaration #define VALUE_SPLIT uint8_t value; -int sensorValue[4] = {0}; +int SensorArray[4] = {0}; // initialization -M5.begin(); -M5.Lcd.clear(); -dacWrite(25, 0);//disable the speak noise -Wire.begin(21, 22, 400000); +m5.begin(); +Serial.begin(115200); +Wire.begin(); // 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); +Wire.beginTransmission(TRACE_ADDR); +Wire.write(0x00); +Wire.endTransmission(); +Wire.requestFrom(TRACE_ADDR,1); +while(Wire.available()){ + value = Wire.read(); } +SensorArray[3] = (value&0x08)>>3; +SensorArray[2] = (value&0x04)>>2; +SensorArray[1] = (value&0x02)>>1; +SensorArray[0] = (value&0x01)>>0; ``` + + ### 2. UIFlow *具体例程请点击[这里](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/TRACE/UIFlow)。* - + ### 管脚映射 -
M5Core(GROVE接口A)GPIO22GPIO215VGND
TRACE UnitSCLSDA5VGND
\ No newline at end of file + + +## 相关视频 + +**TRACE 的演示** + + \ No newline at end of file