Skip to content

Led Matrix : random bits on lines or columns #226

Closed
@paulvha

Description

@paulvha

When using ArduinoGraphics on the Led Matrix and doing a scroll left random bits are showing in the RIGHT columns. This is happening as well when doing a scroll up, on the bottom lines.

It was noticed already doing development given the remark in the function endDraw() in Arduino_LED_matrix.h:

// clear first line (no idea why it gets filled with random bits, probably some math not working fine for super small displays)

The root cause is related to ArduinoGraphics as it returns NEGATIVE numbers when scrolling. In the function set() in Arduino_led_matrix.h it checks for out of bound values, BUT not for negative values for Y and X. Then when doing a _canvasBuffer[y][x] will cause under desired memory to be written.

Solution :

change in function set(), line 251 from:

if (y >= canvasHeight || x >= canvasWidth) {

to:

if (y >= canvasHeight || x >= canvasWidth || y < 0 || x < 0) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions