mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
fixed bug about camera docs and add some arduino api for lcd
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# API Reference
|
||||
|
||||
[中文](/zh_CN/api_reference) | English | [日本語](/ja/api_reference)
|
||||
[中文](zh_CN/api_reference) | English | [日本語](ja/api_reference)
|
||||
|
||||
| MicroPython | Arduino |
|
||||
|:------------|:--------|
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
### Coming soon...
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
The **<mark>ESP32Cam</mark>** is a tiny unit based on ESP32 chip and OV2640. You can even program it through Arduino IDE.
|
||||
The **<mark>ESP32Cam</mark>** is a tiny unit based on ESP32 chip and OV2640. You can even program it through ESP-IDF.
|
||||
|
||||
The ESP32Cam equips the ESP32 with everything necessary to program, run and develop on the wonderful chip. It also features a LiPo charger , so your ESP32Cam project can be battery-powered and truly wireless. Additionally, the board reserved the MPU6050,BME280 and an analog MIC.
|
||||
The ESP32Cam equips the ESP32 with everything necessary to program, run and develop on the wonderful chip. It also features a LiPo charger , so your ESP32Cam project can be battery-powered and truly wireless. Additionally, the board reserved the Welding positions of MPU6050,BME280 and an analog MIC.
|
||||
|
||||
|
||||
## INCLUDES
|
||||
@@ -51,6 +51,8 @@ The ESP32Cam equips the ESP32 with everything necessary to program, run and deve
|
||||
- **[Example](https://github.com/m5stack/esp32-cam-demo/tree/m5cam) (ESP32)**
|
||||
- **[Datasheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_cn.pdf) (ESP32)**
|
||||
- **[Datasheet](https://www.uctronics.com/download/cam_module/OV2640DS.pdf) (OV2640)**
|
||||
- **[PinMap](https://github.com/m5stack/M5-Schematic/blob/master/Units/esp32-cam/hardware_diff_with_ESP32CAM_M5Camera.md)**
|
||||
- **[Schematic](https://github.com/m5stack/M5-Schematic/blob/master/Units/esp32-cam/M5CAM-ESP32-A1-POWER.pdf)**
|
||||
- **[Quick Start](/en/quick_start/m5camera/m5camera_quick_start)**
|
||||
- [ESP32Cam purchase (AliExpress)](https://www.aliexpress.com/store/product/M5Stack-Official-ESP32-Camera-Module-Development-Board-OV2640-Camera-Type-C-Grove-Port-3D-Wifi-Antenna/3226069_32881414545.html)
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
The **<mark>M5Camera</mark>** is a tiny unit based on ESP32 chip and OV2640 <mark>including PSRAM</mark>. You can even program it through Arduino IDE.
|
||||
The **<mark>M5Camera</mark>** is a tiny unit based on ESP32 chip and OV2640 <mark>including PSRAM</mark>. You can even program it through ESP-IDF.
|
||||
|
||||
The M5Camera equips the ESP32 with everything necessary to program, run and develop on the wonderful chip. It also features a LiPo charger (IP5306) , so your M5Camera project can be battery-powered and truly wireless. Additionally, the board reserved the MPU6050,BME280 and an analog MIC.
|
||||
The M5Camera equips the ESP32 with everything necessary to program, run and develop on the wonderful chip. It also features a LiPo charger (IP5306) , so your M5Camera project can be battery-powered and truly wireless. Additionally, the board reserved the Welding positions of MPU6050,BME280 and an analog MIC.
|
||||
|
||||
|
||||
## INCLUDES
|
||||
@@ -50,6 +50,7 @@ The M5Camera equips the ESP32 with everything necessary to program, run and deve
|
||||
- **[Example](https://github.com/m5stack/esp32-cam-demo/tree/m5cam-psram) (ESP32)**
|
||||
- **[Datasheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_cn.pdf) (ESP32)**
|
||||
- **[Datasheet](https://www.uctronics.com/download/cam_module/OV2640DS.pdf) (OV2640)**
|
||||
- **[PinMap](https://github.com/m5stack/M5-Schematic/blob/master/Units/m5camera/hardware_diff_with_ESP32CAM_M5Camera.md)**
|
||||
- **[Quick Start](/en/quick_start/m5camera/m5camera_quick_start)**
|
||||
|
||||
<figure>
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
|
||||
*This document is intended to help you set up the software environment(<mark>Arudino</mark>, <mark>MicroPython</mark>) for development of M5Stack. Through a simple example we would like to illustrate how to develop M5Stack boards, firmware(<mark>Arduino</mark>) or source files(<mark>MicroPython</mark>) download to M5Stack boards.*
|
||||
|
||||
<img src="assets/img/getting_started_pics/m5stack_core.png"> | <img src="assets/img/getting_started_pics/m5camera.jpg"> | <img src="assets/img/getting_started_pics/M5Bala.jpg">
|
||||
---|---|---
|
||||
<img src="assets/img/getting_started_pics/m5stack_core.png"> | <img src="assets/img/getting_started_pics/m5camera.jpg">
|
||||
---|---
|
||||
[M5StackCore](/en/quick_start/m5core/m5stack_core_quick_start) | [M5Camera](/en/quick_start/m5camera/m5camera_quick_start)
|
||||
<!-- | [M5BALA](/en/quick_start/bala/bala_quick_start) -->
|
||||
|
||||
<!-- ## Practice
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
# API Reference
|
||||
|
||||
中文 | [English](/en/api_reference) | [日本語](/ja/api_reference)
|
||||
|
||||
*这是MicroPython的编程API*
|
||||
|
||||
中文 | [English](en/api_reference) | [日本語](ja/api_reference)
|
||||
|
||||
| MicroPython | Arduino |
|
||||
|:------------|:--------|
|
||||
|[LCD](zh_CN/api_reference/micropython/api_lcd) | / |
|
||||
|[LCD](zh_CN/api_reference/micropython/api_lcd) | [LCD](zh_CN/api_reference/arduino/api_lcd) |
|
||||
|
||||
<!-- |[BUTTON](zh_CN/api_reference/micropython/api_lcd) | [BUTTON](zh_CN/api_reference/arduino/api_lcd) |
|
||||
|[SPEAKER](zh_CN/api_reference/micropython/api_lcd) | [SPEAKER](zh_CN/api_reference/arduino/api_lcd) | -->
|
||||
|
||||
<!-- ## [LCD](zh_CN/api_reference/micropython/api_lcd) -->
|
||||
<!-- ## [Peripherals](zh_CN/api_reference/peripherals/api_gpio)
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
# 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>lcd.drawPixel(x, y [,color])</mark>
|
||||
**例程**
|
||||
```python
|
||||
lcd.drawPixel(22,22,lcd.RED)
|
||||
```
|
||||
**在位置(x,y)处画点。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| color | 颜色值 |
|
||||
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>lcd.drawLine(x, y, x1, y1 [,color])</mark>
|
||||
**例程**
|
||||
```python
|
||||
lcd.drawLine(0,0,12,12,lcd.WHITE)
|
||||
```
|
||||
**以指定的颜色从点(x,y)到点(x1,y1)画直线。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| color | 颜色值 |
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>lcd.drawTriangle(x, y, x1, y1, x2, y2 [,color])</mark>
|
||||
|
||||
**例程**
|
||||
```python
|
||||
lcd.drawTriangle(22,22,69,98,51,22,lcd.RED)
|
||||
```
|
||||
|
||||
**以指定颜色画三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| color | 颜色值 |
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>lcd.fillTriangle(x, y, x1, y1, x2, y2 [,color])</mark>
|
||||
|
||||
**例程**
|
||||
```python
|
||||
lcd.fillTriangle(122, 122, 169, 198, 151, 182, lcd.RED)
|
||||
```
|
||||
**以指定颜色画<mark>填充形式</mark>的三角形,顶点分别为(x,y),(x1,y1)和(x2,y2)。**
|
||||
|
||||
*如果函数的color值没给出,则使用当前的背景颜色。*
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| color | 颜色值 |
|
||||
|
||||
|
||||
* * *
|
||||
### <mark>lcd.drawRect(x, y, w, h, [,color])</mark>
|
||||
**例程**
|
||||
```python
|
||||
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>
|
||||
**例程**
|
||||
```python
|
||||
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>
|
||||
**例程**
|
||||
```python
|
||||
lcd.print('this is a print text function', 80, 80)
|
||||
```
|
||||
**在(x,y)处开始打印文本(字符串)text。**
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| text | 要打印的内容 |
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### <mark>lcd.clear([color])</mark>
|
||||
|
||||
**例程**
|
||||
```python
|
||||
lcd.clear()
|
||||
```
|
||||
|
||||
**清屏(即以当前的背景颜色填充整个屏幕)。**
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
### Usage
|
||||
|
||||
```python
|
||||
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)
|
||||
``` -->
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
中文 | [English](/en/api_reference/micropython/api_lcd) | [日本語](/ja/api_reference/micropython/api_lcd)
|
||||
|
||||
*屏幕像素为320x240,以屏幕左上角为原点(0,0)*
|
||||
|
||||
### <mark>lcd.setRotation(degree)</mark>
|
||||
|
||||
**例程**
|
||||
@@ -163,7 +165,7 @@ lcd.fillRoundRect(180,70,122,10,4,lcd.BLUE)
|
||||
lcd.print('this is a print text function', 80, 80)
|
||||
```
|
||||
**在(x,y)处开始打印文本(字符串)text。**
|
||||
|
||||
|
||||
| 参数 | 描述 |
|
||||
| --- | --- |
|
||||
| text | 要打印的内容 |
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
### 在编辑中...
|
||||
|
||||
### 敬请期待...
|
||||
Reference in New Issue
Block a user