@@ -6,11 +6,12 @@ to Micro-Python / Python 3 for the [DumbDisplay Android app](https://play.google
66For a video introduction, please watch the YouTube video: [ Introducing DumbDisplay MicroPython Library --
77with ESP32, Raspberry Pi Pico, and Raspberry Pi Zero] ( https://www.youtube.com/watch?v=KVU26FyXs5M )
88
9- Although the porting is not complete , nevertheless, a large portion of DumbDisplay functionalities have been ported.
9+ Although the porting is work in progress , nevertheless, a large portion of DumbDisplay functionalities have been ported.
1010Hopefully, this should already be helpful for friends that develop programs for microcontroller boards in Micro-Python.
1111
12- As hinted previously, even it is originally targeted for MicroPython, it should be useful with regular Python 3, like in Raspberry Pi environment
12+ As hinted previously, even it is originally targeted for MicroPython, it should be useful with regular Python 3, like in Raspberry Pi environment
1313or even with desktop / laptop.
14+ As a result, it can be an alternative way to prototype Android app driven remotely with Python 3 from desktop / laptop.
1415
1516
1617Enjoy
2728# Installation
2829
2930For Micro-Python, please refer to the [ above-mentioned YouTube video] ( https://www.youtube.com/watch?v=KVU26FyXs5M )
30- for examples of using DumbDisplay MicroPython Library for microcontroller boards programming.
31+ for examples of using DumbDisplay MicroPython Library for microcontroller programming.
3132
32- If your targeted is desktop / laptop, you can install the library by cloning the repository :
33+ If your targeted is desktop / laptop, you can install the package like :
3334```
3435pip install git+https://github.com/trevorwslee/MicroPython-DumbDisplay
3536```
@@ -44,21 +45,23 @@ pip install --upgrade --force-reinstall git+https://github.com/trevorwslee/Micro
4445
4546The basic script setup is:
46471 . import core, for creating ` DumbDisplay ` object
47- 2 . import IO mechanism, for creating IO object
48+ 2 . import IO mechanism, for creating IO object, like
49+ - ` io4Inet ` (the default) -- Python networking support (not available for Micro-Python)
50+ - ` io4Wifi ` -- Micro-Python WiFi support (for Raspberry Pi Pico W, ESP32, etc.)
48513 . import layers, for creating layer objects
4952
50- For example
53+ For example (using Python networking support with ` io4Inet ` as ` io ` )
5154```
5255from dumbdisplay.core import *
5356from dumbdisplay.io_inet import *
5457from dumbdisplay.layer_ledgrid import *
55- dd = DumbDisplay(io4Inet() )
58+ dd = DumbDisplay() # default io is io4Inet()
5659l = LayerLedGrid(dd)
5760l.turnOn()
5861```
5962
6063
61- A "very simple" sample that makes use of WiFi can be like
64+ A simple sample that explicitly makes use of WiFi ` io4Wifi ` as ` io ` , can be like
6265```
6366from dumbdisplay.core import *
6467from dumbdisplay.io_wifi import *
@@ -81,7 +84,7 @@ A simple sample that polls for feedbacks, can be like
8184from dumbdisplay.core import *
8285from dumbdisplay.io_inet import *
8386from dumbdisplay.layer_ledgrid import *
84- dd = DumbDisplay(io4Inet() )
87+ dd = DumbDisplay() # default io is io4Inet()
8588l = LayerLedGrid(dd, 20, 20)
8689l.enableFeedback("fa")
8790l.offColor(RGB_COLOR(0xcc, 0xcc, 0xcc))
@@ -118,7 +121,7 @@ def feedback_handler(layer, type, x, y):
118121 _last_x = -1
119122
120123
121- dd = DumbDisplay(io4Inet() )
124+ dd = DumbDisplay() # default io is io4Inet()
122125l_r = LayerLcd(dd)
123126l_g = LayerLcd(dd)
124127l_b = LayerLcd(dd)
@@ -134,7 +137,7 @@ l_b.enableFeedback("f", feedback_handler=feedback_handler)
134137l.enableFeedback("fs:rpt50", feedback_handler=feedback_handler)
135138AutoPin('V', AutoPin('H', l_r, l_g, l_b), l).pin(dd)
136139while True:
137- dd.sleep(1 )
140+ dd.timeslice( )
138141```
139142
140143Notes:
0 commit comments