Closed breml closed 1 year ago
Hello, just tested it on mine (1.2? original? nor sure) and x
y
are swapped, not sure when/how this happened. Feel free to make a PR for this, I'll gladly review + approve it
I went back through the git history and I also was not able to figure out when this changed. Is it possible, that this bug has been in there since the beginning?
The microbitmatrix driver does not give me the expected results, if using the
SetPixel
method. The method is defined asSetPixel(x int16, y int16, c color.RGBA)
, where I expectx
to be the horizontal and y the vertical axis and(0, 0)
to be in the upper left corner (ifrotation
is set to0
, which is the default value).This expectation comes from using the Makecode, JavaScript and Python implementations on https://makecode.microbit.org/.
From the help text of the JavaScript
led.plot
function:or Python:
With the following program I expect the LED in the top right corner to light (x = 4, y = 0, rotation = 0), but instead, the LED in the bottom left corner does light.
I have tested the above program on https://play.tinygo.org/ as well as on a microbit V1.5 and microbit V2.20 with the same results.
I quickly copied the code of the microbitmatrix driver to my project and swapped
x
andy
in https://github.com/tinygo-org/drivers/blob/release/microbitmatrix/microbitmatrix.go on lines 31, 33 and 42, which did resolve the problem for me.I am happy to file a PR for this.