mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
rename files in api diretory
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
# LidarBot
|
||||
|
||||
<img src="assets/img/product_pics/app/lidarbot_01.jpg" width="250" height="250"> <img src="assets/img/product_pics/app/lidarbot_02.jpg" width="250" height="250"> <img src="assets/img/product_pics/app/lidarbot_03.jpg" width="250" height="250"> <img src="assets/img/product_pics/app/lidarbot_04.jpg" width="250" height="250"> <img src="assets/img/product_pics/app/lidarbot_05.jpg" width="250" height="250">
|
||||
|
||||
* * *
|
||||
|
||||
:memo:**[Description](#Description)** :octocat:**[Example](https://github.com/m5stack/Applications-LidarBot/tree/master/LidarBot/Example)** 🛒**[Purchase](https://www.aliexpress.com/store/product/M5Stack-New-Lidar-Bot-Mini-Car-Lidar-8m-6Hz-McNamm-Wheels-NeoPixel-LED-Bar-with-ESP32/3226069_32951134988.html?spm=a2g1y.12024536.productList_5885013.subject_7)**
|
||||
|
||||
## Description
|
||||
|
||||
<mark>LidarBot</mark> is a four-wheeled car based on indoor navigation. The car body is loaded with lidar, four Mecanum wheels, control-wheel bottom board(based on MEGA328), two RGB bars, M5Core(CarMainController) and some LEGO holes.
|
||||
|
||||
Real-time communication via ESP-NOW between the car and the remote control handle. After receiving the control signal, the car master controlls the wheels and RGB bars through the specified protocol format.
|
||||
|
||||
And in addition to controlling the car's flexible front, rear, left and right movements, the indoor terrain can also be displayed on the display screens of the car master(M5Core) and the remote control handle.
|
||||
|
||||
## Feature
|
||||
|
||||
- Lidar: 8m @ 6Hz
|
||||
- Programming Support
|
||||
+ Arduino
|
||||
- Compatible LEGO
|
||||
|
||||
## Protocol for CarBottomBoard
|
||||
|
||||
*Protocol Format:Data Header(command type) + Data Packet + Data Tail*
|
||||
|
||||
| Control Target | Protocol Format |
|
||||
| :-------------: |:------------------------------------: |
|
||||
| Wheels | 0xAA,SpeedX,SpeedY,SpeedZ,SpeedA,0x55 |
|
||||
| One RGB | 0xAB,LedIndex,R,G,B,0x55 |
|
||||
| Front RGB Bar | 0xAC,R,G,B,0x55 |
|
||||
| Back RGB Bar | 0xAD,R,G,B,0x55 |
|
||||
| All RGB | 0xAE,R,G,B,0x55 |
|
||||
| ServoMotor0 | 0xAF,Angle,0x55 |
|
||||
| ServoMotor1 | 0xB0,Angle,0x55 |
|
||||
|
||||
## PARAMETER
|
||||
|
||||
- Communication Parameter
|
||||
- M5Core(CarMain) <-> Lidar(GPIO16 <-> Lidar)
|
||||
Serial Configuration: "230400bps, 8, n, 1"(8 bits data, no parity, 1 stop bit)
|
||||
- M5Core(CarMain) <-> CarBottomBoard(GPIO17 <-> Lidar)
|
||||
Serial Configuration: "115200bps, 8, n, 1"(8 bits data, no parity, 1 stop bit)
|
||||
- PinMap
|
||||
- ServoMotor0 <-> A0(MEGA328)
|
||||
- ServoMotor1 <-> A1(MEGA328)
|
||||
- NeoPixelRGB <-> 11(MEGA328)
|
||||
|
||||
## Include
|
||||
|
||||
- 1x LidarBot
|
||||
- 1x Remote Control Handle
|
||||
- 2x Battery(1300mAh @ 11.1V)
|
||||
- 1x Power Charger
|
||||
- 1x Type-C USB Cable
|
||||
|
||||
## APPLICATIONS
|
||||
|
||||
- Indoor Navigation
|
||||
- Autonomous walking maze
|
||||
- Route plan
|
||||
- Autopilot
|
||||
@@ -1,144 +0,0 @@
|
||||
# LCD
|
||||
|
||||
<!-- 中文 | [English](/en/api_reference/micropython/api_lcd) | [日本語](/ja/api_reference/micropython/api_lcd) -->
|
||||
|
||||
*画面の解像度は横320x縦240で左上を(0,0)とします。*
|
||||
|
||||
### <mark>M5.lcd.setBrightness(uint8_t brightness);</mark>
|
||||
|
||||
**画面全体の明るさを設定します。**
|
||||
|
||||
| 引数 | 説明 |
|
||||
|:---|:---|
|
||||
| brightness | 画面の明るさ(0-254) |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.lcd.setBrightness(200);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### <mark>M5.Lcd.setCursor(uint16_t x0, uint16_t y0);</mark>
|
||||
|
||||
**表示開始位置を設定します。(x0, y0)**
|
||||
|
||||
| パラメータ | 説明 |
|
||||
|:---|:---|
|
||||
| x0 | カーソルのx座標 |
|
||||
| y0 | カーソルのy座標 |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.lcd.setCursor(20, 40);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### <mark>M5.Lcd.fillScreen(uint16_t color);</mark>
|
||||
|
||||
**画面全体を指定された色で塗りつぶします。**
|
||||
|
||||
| パラメータ | 説明 |
|
||||
|:---|:---|
|
||||
| color | 塗りつぶしの色 |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.Lcd.fillScreen(BLUE);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### <mark>M5.Lcd.drawPixel(int16_t x, int16_t y, [uint16_t color]);</mark>
|
||||
|
||||
**位置(x, y)にcolorで指定した色の点を描画します。**
|
||||
|
||||
*もしcolorを指定しない場合は、現在の背景色が使用されます。*
|
||||
|
||||
| パラメータ | 説明 |
|
||||
|:---|:---|
|
||||
| x | 点のx座標 |
|
||||
| y | 点のy座標 |
|
||||
| color | 点の色 |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.Lcd.drawPixel(20, 40, BLUE);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### <mark>M5.Lcd.drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);</mark>
|
||||
|
||||
**始点(x0, y0)から終点(x1, y1)にcolorで指定した色の直線を描画します。**
|
||||
|
||||
*もしcolorを指定しない場合は、現在の背景色が使用されます。*
|
||||
|
||||
| パラメータ | 説明 |
|
||||
|:---|:---|
|
||||
| x0 | 線の始点のx座標 |
|
||||
| y0 | 線の始点のy座標 |
|
||||
| x1 | 線の終点のx座標 |
|
||||
| y1 | 線の終点のy座標 |
|
||||
| color | 線の色 |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.Lcd.drawLine(0, 0, 12, 12, BLUE);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### <mark>M5.Lcd.drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);</mark>
|
||||
|
||||
**colorで指定した色の線で3つの頂点(x0, y0)、(x1, y1)、(x2, y2)を持つ三角形を描画します。**
|
||||
|
||||
*もしcolorを指定しない場合は、現在の背景色が使用されます。*
|
||||
|
||||
| パラメータ | 説明 |
|
||||
|:---|:---|
|
||||
| x0 | 三角形の頂点Aのx座標 |
|
||||
| y0 | 三角形の頂点Aのy座標 |
|
||||
| x1 | 三角形の頂点Bのx座標 |
|
||||
| y1 | 三角形の頂点Bのy座標 |
|
||||
| x2 | 三角形の頂点Cのx座標 |
|
||||
| y2 | 三角形の頂点Cのy座標 |
|
||||
| color | 線の色 |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.Lcd.drawTriangle(22, 22, 69, 98, 51, 22, BLUE);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### <mark>M5.Lcd.fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);</mark>
|
||||
|
||||
**colorで指定した色に<mark>塗りつぶされた</mark>頂点(x0, y0)、(x1, y1)、(x2, y2)を持つ三角形を描画します。**
|
||||
|
||||
*もしcolorを指定しない場合は、現在の背景色が使用されます。*
|
||||
|
||||
| パラメータ | 説明 |
|
||||
|:---|:---|
|
||||
| x0 | 三角形の頂点Aのx座標 |
|
||||
| y0 | 三角形の頂点Aのy座標 |
|
||||
| x1 | 三角形の頂点Bのx座標 |
|
||||
| y1 | 三角形の頂点Bのy座標 |
|
||||
| x2 | 三角形の頂点Cのx座標 |
|
||||
| y2 | 三角形の頂点Cのy座標 |
|
||||
| color | 線の色 |
|
||||
|
||||
**使用例**
|
||||
|
||||
```c++
|
||||
M5.Lcd.fillTriangle(122, 122, 169, 198, 151, 182, BLUE);
|
||||
```
|
||||
|
||||
---
|
||||
@@ -1,180 +0,0 @@
|
||||
# LCD
|
||||
|
||||
<!-- 中文 | [English](/en/api_reference/micropython/api_lcd) | [日本語](/ja/api_reference/micropython/api_lcd) -->
|
||||
|
||||
*屏幕像素为320x240,以屏幕左上角为原点(0,0)*
|
||||
|
||||
### <mark>M5.lcd.setBrightness(uint8_t brightness);</mark>
|
||||
|
||||
**例程**
|
||||
```c++
|
||||
M5.lcd.setBrightness(200);
|
||||
```
|
||||
|
||||
**设置整个屏幕显示的亮度。**
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| brightness | 屏幕的亮度(0-254) |
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>M5.Lcd.setCursor(uint16_t x0, uint16_t y0);</mark>
|
||||
|
||||
**例程**
|
||||
```c++
|
||||
M5.lcd.setCursor(20, 40);
|
||||
```
|
||||
|
||||
**设置下一次要显示的起始位置(x0, y0)**
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>M5.Lcd.fillScreen(uint16_t color);</mark>
|
||||
**例程**
|
||||
```c++
|
||||
M5.Lcd.fillScreen(BLUE);
|
||||
```
|
||||
**以指定的颜色填充整个屏幕。**
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| color | 颜色值 |
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>M5.Lcd.drawPixel(int16_t x, int16_t y, uint16_t color);</mark>
|
||||
**例程**
|
||||
```c++
|
||||
M5.Lcd.drawPixel(20, 40);
|
||||
```
|
||||
**在位置(x,y)处画color颜色的点。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>M5.Lcd.drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);</mark>
|
||||
**例程**
|
||||
```c++
|
||||
M5.Lcd.drawLine(0,0,12,12,BLUE);
|
||||
```
|
||||
**以指定的颜色color从点(x0,y0)到点(x1,y1)画直线。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>M5.Lcd.drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);</mark>
|
||||
|
||||
**例程**
|
||||
```c++
|
||||
M5.Lcd.drawTriangle(22,22,69,98,51,22,BLUE);
|
||||
```
|
||||
|
||||
**以指定颜色color画三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>M5.Lcd.fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);</mark>
|
||||
|
||||
**例程**
|
||||
```c++
|
||||
M5.Lcd.fillTriangle(122, 122, 169, 198, 151, 182, BLUE);
|
||||
```
|
||||
**以指定颜色画<mark>填充形式</mark>的三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
|
||||
* * *
|
||||
<!-- ### <mark>lcd.drawRect(x, y, w, h, [,color])</mark>
|
||||
**例程**
|
||||
```c++
|
||||
lcd.drawRect(180, 12, 122, 10, lcd.BLUE)
|
||||
```
|
||||
**以指定颜色画矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| w | 图形宽(单位: 像素) |
|
||||
| h | 图形高(单位: 像素) |
|
||||
| color | 颜色值 |
|
||||
|
||||
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>lcd.drawRoundRect(x, y, w, h, r [,color])</mark>
|
||||
**例程**
|
||||
```c++
|
||||
lcd.fillRoundRect(180,70,122,10,4,lcd.BLUE)
|
||||
```
|
||||
**以指定颜色画<mark>圆角</mark>矩形,其中矩形左上角坐标为(x,y),宽高分别为width和height,圆角半径为r。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| w | 图形宽(单位: 像素) |
|
||||
| h | 图形高(单位: 像素) |
|
||||
| r | 圆角半径 |
|
||||
| color | 颜色值 |
|
||||
|
||||
|
||||
|
||||
|
||||
* * *
|
||||
### <mark>lcd.print(‘text’, [x, y])</mark>
|
||||
**例程**
|
||||
```c++
|
||||
lcd.print('this is a print text function', 80, 80)
|
||||
```
|
||||
**在(x,y)处开始打印文本(字符串)text。**
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| text | 要打印的内容 |
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>lcd.clear([color])</mark>
|
||||
|
||||
**例程**
|
||||
```c++
|
||||
lcd.clear()
|
||||
```
|
||||
|
||||
**清屏(即以当前的背景颜色填充整个屏幕)。**
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### Usage
|
||||
|
||||
```c++
|
||||
from machine import SPI, Pin
|
||||
from display import LCD
|
||||
|
||||
spi = SPI(1, baudrate=32000000, mosi=Pin(23), miso=Pin(19), sck=Pin(18))
|
||||
|
||||
lcd = LCD(spi = spi) #lcd init
|
||||
lcd.fillScreen(lcd.BLACK) #set the default background color
|
||||
|
||||
lcd.drawLine(0, 0, lcd.WHITE)
|
||||
lcd.drawTriangle(22, 22, 69, 98, 51, 22, lcd.RED)
|
||||
lcd.fillTriangle(122, 122, 169, 198, 151, 182, lcd.RED)
|
||||
lcd.drawCircle(180, 180, 10, lcd.BLUE)
|
||||
lcd.fillcircle(100, 100, 10, lcd.BLUE)
|
||||
lcd.drawRect(180, 12, 122, 10, lcd.BLUE)
|
||||
lcd.fillRect(180, 30, 122, 10, lcd.BLUE)
|
||||
lcd.drawRoundRect(180, 50, 122, 10, 4, lcd.BLUE)
|
||||
lcd.fillRoundRect(180, 70, 122, 10, 4, lcd.BLUE)
|
||||
lcd.print('this is a print text function', 80, 80)
|
||||
``` -->
|
||||
Reference in New Issue
Block a user