Skip to content

Commit 4e3e2c8

Browse files
authored
Merge pull request #876 from pimoroni/docs/picoscroll
update picoscroll docs
2 parents 5bd5334 + a60c856 commit 4e3e2c8

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

micropython/modules/pico_scroll/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ We've included helper functions to handle every aspect of drawing to the matrix
1313
- [show\_text](#show_text)
1414
- [scroll\_text](#scroll_text)
1515
- [show\_bitmap\_1d](#show_bitmap_1d)
16-
- [update](#update)
16+
- [show](#show)
1717
- [clear](#clear)
1818
- [is\_pressed](#is_pressed)
1919

2020
## Example Program
2121

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.
2323

2424
```python
2525
from picoscroll import PicoScroll
@@ -37,17 +37,22 @@ for y in range (0, picoscroll.get_height()):
3737
brightness += 2
3838

3939
# Push the data to the matrix
40-
picoscroll.update()
40+
picoscroll.show()
4141

4242
# Wait until the A button is pressed
4343
while picoscroll.is_pressed(picoscroll.BUTTON_A) == False:
4444
pass
4545

4646
# Set the brightness of all pixels to 0
4747
picoscroll.clear()
48-
picoscroll.update()
48+
picoscroll.show()
4949
```
5050

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)
55+
5156
## Function reference
5257

5358
### get_width
@@ -62,7 +67,7 @@ height_in_pixels = picoscroll.get_height()
6267

6368
### set_pixel
6469

65-
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.
6671

6772
```python
6873
picoscroll.set_pixel(x, y, l)
@@ -72,7 +77,7 @@ picoscroll.set_pixel(x, y, l)
7277

7378
This function sets all pixel at once from a `bytearray` image indexed
7479
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.
7681

7782
```python
7883
image = bytearray(0 for j in range(width * height))
@@ -92,7 +97,7 @@ word = "Hello, world!"
9297
l = len(word) * 6
9398
for j in range(-17, l):
9499
picoscroll.show_text(word, 8, j)
95-
picoscroll.update()
100+
picoscroll.show()
96101
time.sleep(0.1)
97102
```
98103

@@ -102,7 +107,7 @@ The full 256 characters can be displayed with:
102107
b = bytearray(range(256))
103108
for j in range(256*6):
104109
picoscroll.show_text(b, 8, j)
105-
picoscroll.update()
110+
picoscroll.show()
106111
time.sleep(0.1)
107112
```
108113

@@ -129,29 +134,29 @@ Show a view of a bitmap stored as the 7 least significant bits of
129134
bytes in a `bytearray`, top-down. Individual pixels are set to
130135
`brightness` based on individual bit values, with the view defined by
131136
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.
133138

134139
```python
135140
bitmap = bytearray(j for j in range 127)
136141
for offset in range(-17, 127):
137142
picoscroll.show_bitmap_1d(bitmap, 16, offset)
138-
picoscroll.update()
143+
picoscroll.show()
139144
```
140145

141146
will scroll a binary counter across the display (i.e. show `0x00` to
142147
`0x7f` in binary).
143148

144-
### update
149+
### show
145150

146151
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.
147152

148153
```python
149-
picoscroll.update()
154+
picoscroll.show()
150155
```
151156

152157
### clear
153158

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.
155160

156161
```python
157162
picoscroll.clear()

0 commit comments

Comments
 (0)