怎么用micropython编写libili9341的Negative Gamma Correction默认值
时间: 2023-07-05 12:07:04 浏览: 118
要使用Micropython编写libili9341的负伽马校正默认值,可以按照以下步骤进行:
1. 首先,需要导入SPI库和ili9341库,例如:
```python
import machine
import ili9341
# define SPI pins
spi = machine.SPI(1, baudrate=40000000, polarity=0, phase=0)
# define TFT display pins
cs = machine.Pin(15)
dc = machine.Pin(2)
rst = machine.Pin(0)
# create TFT display object
tft = ili9341.ILI9341(spi, cs=cs, dc=dc, rst=rst)
```
2. 然后,需要设置负伽马校正的默认值,例如:
```python
# set negative gamma correction default values
tft.write(b'\xe2\x0f\x1a\x0f\x18\x2f\x28\x20\x22\x1f\x1b\x23\x37\x00\x07\x02\x10')
```
3. 最后,可以在程序中使用TFT显示器,例如:
```python
# fill screen with red color
tft.fill(ili9341.RED)
# draw text on screen
tft.text('Hello, world!', 10, 10, ili9341.WHITE)
# update screen
tft.update()
```
通过以上步骤,您就可以使用Micropython编写libili9341的负伽马校正默认值,并在TFT显示器上显示内容。
阅读全文
相关推荐














