https://github.com/bpi-steam/mircopython-display
在 bpibit 上运行和 microbit 一样的 display 。
https://github.com/bpi-steam/mircopython-display
bpibit led mircopython
Last synced: 11 months ago
JSON representation
在 bpibit 上运行和 microbit 一样的 display 。
- Host: GitHub
- URL: https://github.com/bpi-steam/mircopython-display
- Owner: BPI-STEAM
- Created: 2019-04-13T12:13:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-10T13:20:05.000Z (almost 7 years ago)
- Last Synced: 2025-03-03T01:32:41.759Z (over 1 year ago)
- Topics: bpibit, led, mircopython
- Language: Python
- Homepage: Run: the same display as microbit on bpibit.
- Size: 21.9 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# MircoPython - Display
#### 📖 [English document](https://github.com/aJantes/MircoPython-led/blob/master/english_document.md)

> 模块介绍:
- [BPI:bit(ESP32)](https://github.com/aJantes/introduce-bpi-bit/blob/master/README.md)
- [LED灯(WS2812B)](https://github.com/aJantes/MircoPython-led/blob/master/source/WS2812B.pdf)
# LED 矩阵显示
LED 矩阵 硬件相关函数 [display 模块](https://github.com/aJantes/MircoPython-led/blob/master/source/display.py)。在调用相关函数前,需要先导入对应的库。
``` shell
mpfs [/]> open
looking for all port...
Connected to esp32
mpfs [/]> put display.py
mpfs [/]> ls
Remote files in '/':
boot.py
wifi_cfg.py
display.py
mpfs [/]>
```
``` python
import display
display = display.display()
display.scroll("Hello World!", color=Red, delay=150)
```
``` python
import display
display().scroll("Hello World!", color=Red, delay=150)
```
## 主要函数
- `display.scroll("Hello World!", color=Red, delay=150)`:
在 led 矩阵滚动显示红色色的 "Hello World!" 字符串,滚动的时间间隔为 150 ms。
- `display.show(Image.ALL_CLOCKS, loop=True, delay=100)` :
在 led 矩阵通过led的亮灭显示出时钟。时钟循环播放,每次的变化间隔为 100 ms。
---
## 例程
文件|功能
:--|:--
[show_text.py](https://github.com/aJantes/MircoPython-led/blob/master/example/show_text.py) | 显示简单文本
[display_yellow_text.py](https://github.com/aJantes/MircoPython-led/blob/master/example/display_yellow_text.py) | 显示黄色文本
[display_color_text.py](https://github.com/aJantes/MircoPython-led/blob/master/example/display_color_text.py) | 显示多色文本
[display_custom_color.py](https://github.com/aJantes/MircoPython-led/blob/master/example/display_custom_color.py) | 显示自定义颜色文本
[show_image.py](https://github.com/aJantes/MircoPython-led/blob/master/example/show_image.py) | 显示内置图像
[show_my_image.py](https://github.com/aJantes/MircoPython-led/blob/master/example/show_my_image.py) | 显示自定义图像
[show_clock.py](https://github.com/aJantes/MircoPython-led/blob/master/example/show_clock.py) | 显示内置动画
[show_animation.py](https://github.com/aJantes/MircoPython-led/blob/master/example/show_animation.py) | 显示自定义动画