You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: micropython/modules/pico_scroll/README.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ We've included helper functions to handle every aspect of drawing to the matrix
13
13
-[show\_text](#show_text)
14
14
-[scroll\_text](#scroll_text)
15
15
-[show\_bitmap\_1d](#show_bitmap_1d)
16
-
-[update](#update)
16
+
-[show](#show)
17
17
-[clear](#clear)
18
18
-[is\_pressed](#is_pressed)
19
19
20
20
## Example Program
21
21
22
-
The following example sets up the matrix, sets each pixel to an increasing brightnesses level, and then clears the matrix only after button A is pressed.
22
+
The following example sets up the matrix, sets each pixel to an increasing brightness level, and then clears the matrix only after button A is pressed.
23
23
24
24
```python
25
25
from picoscroll import PicoScroll
@@ -37,17 +37,22 @@ for y in range (0, picoscroll.get_height()):
37
37
brightness +=2
38
38
39
39
# Push the data to the matrix
40
-
picoscroll.update()
40
+
picoscroll.show()
41
41
42
42
# Wait until the A button is pressed
43
43
while picoscroll.is_pressed(picoscroll.BUTTON_A) ==False:
44
44
pass
45
45
46
46
# Set the brightness of all pixels to 0
47
47
picoscroll.clear()
48
-
picoscroll.update()
48
+
picoscroll.show()
49
49
```
50
50
51
+
You can now also use Scroll Pack with our tiny PicoGraphics library which has a ton of useful functions for drawing text and shapes:
52
+
53
+
-[PicoGraphics example for Scroll Pack](/micropython/examples/pico_scroll/picographics_scroll_text.py)
54
+
-[PicoGraphics function reference](/micropython/modules/picographics/README.md)
This function sets a pixel at the `x` and `y` coordinates to a brightness level specified by the `l` parameter. The value of `l` must be 0-255. Changes will not be visible until `update()` is called.
70
+
This function sets a pixel at the `x` and `y` coordinates to a brightness level specified by the `l` parameter. The value of `l` must be 0-255. Changes will not be visible until `show()` is called.
66
71
67
72
```python
68
73
picoscroll.set_pixel(x, y, l)
@@ -72,7 +77,7 @@ picoscroll.set_pixel(x, y, l)
72
77
73
78
This function sets all pixel at once from a `bytearray` image indexed
74
79
as `y * picoscroll.get_width() + x`, containing brightness levels
75
-
between 0 and 255. Changes will not be visible until `update()` is called.
80
+
between 0 and 255. Changes will not be visible until `show()` is called.
76
81
77
82
```python
78
83
image =bytearray(0for j inrange(width * height))
@@ -92,7 +97,7 @@ word = "Hello, world!"
92
97
l =len(word) *6
93
98
for j inrange(-17, l):
94
99
picoscroll.show_text(word, 8, j)
95
-
picoscroll.update()
100
+
picoscroll.show()
96
101
time.sleep(0.1)
97
102
```
98
103
@@ -102,7 +107,7 @@ The full 256 characters can be displayed with:
102
107
b =bytearray(range(256))
103
108
for j inrange(256*6):
104
109
picoscroll.show_text(b, 8, j)
105
-
picoscroll.update()
110
+
picoscroll.show()
106
111
time.sleep(0.1)
107
112
```
108
113
@@ -129,29 +134,29 @@ Show a view of a bitmap stored as the 7 least significant bits of
129
134
bytes in a `bytearray`, top-down. Individual pixels are set to
130
135
`brightness` based on individual bit values, with the view defined by
131
136
the offset and the width of the scroll (i.e. 17 columns). Changes will
132
-
not be visible until `update()` is called.
137
+
not be visible until `show()` is called.
133
138
134
139
```python
135
140
bitmap =bytearray(j for j inrange127)
136
141
for offset inrange(-17, 127):
137
142
picoscroll.show_bitmap_1d(bitmap, 16, offset)
138
-
picoscroll.update()
143
+
picoscroll.show()
139
144
```
140
145
141
146
will scroll a binary counter across the display (i.e. show `0x00` to
142
147
`0x7f` in binary).
143
148
144
-
### update
149
+
### show
145
150
146
151
Pushes pixel data from the Pico to the Scroll Pack. Until this function is called any `set_pixel` or `clear` calls won't have any visible effect.
147
152
148
153
```python
149
-
picoscroll.update()
154
+
picoscroll.show()
150
155
```
151
156
152
157
### clear
153
158
154
-
Sets the brightness of all pixels to `0`. Will not visibly take effect until `update` is called.
159
+
Sets the brightness of all pixels to `0`. Will not visibly take effect until `show` is called.
0 commit comments