kopia lustrzana https://github.com/pimoroni/pimoroni-pico
rodzic
e1027353ab
commit
d17cd858b5
|
@ -88,7 +88,7 @@ picoscroll.set_pixels(image)
|
|||
### show_bitmap_1d
|
||||
|
||||
Show a view of a bitmap stored as the 7 least significant bits of
|
||||
bytes in a `bytearray`, top-down. Individual pixels are set to
|
||||
bytes in a `bytearray`, bottom-up. Individual pixels are set to
|
||||
`brightness` based on individual bit values, with the view defined by
|
||||
the offset and the width of the scroll (i.e. 17 columns). Changes will
|
||||
not be visible until `update()` is called.
|
||||
|
|
|
@ -111,7 +111,7 @@ mp_obj_t picoscroll_show_bitmap_1d(mp_obj_t bitmap_obj, mp_obj_t brightness_obj,
|
|||
|
||||
for (int x = 0; x < width; x++) {
|
||||
int k = offset + x;
|
||||
if ((k >= 0) && (k <= length)) {
|
||||
if ((k >= 0) && (k < length)) {
|
||||
unsigned char col = values[k];
|
||||
for (int y = 0; y < height; y++) {
|
||||
int val = brightness * ((col >> y) & 1);
|
||||
|
|
Ładowanie…
Reference in New Issue