Page 1 of 1

Accessing the row pins for LED display

Posted: Wed Jun 17, 2020 11:40 am
by kjw
Is it possible to access the pins for the rows of the LED display to allow direct, low-level control of the LED screen after a display_off(), of course? The columns appear to be available as microbit.pinX but I've not worked out how to access the rows.

Re: Accessing the row pins for LED display

Posted: Mon Jun 29, 2020 7:10 am
by jimmo
kjw wrote:
Wed Jun 17, 2020 11:40 am
The columns appear to be available as microbit.pinX but I've not worked out how to access the rows.
My understanding is that the column pins are available because they are also shared with the edge connector.

If you want to access the row pins you can do so via machine.mem32 to read and write the pin registers directly... (not fun, but also once you've got it working it's very simple).

e.g. this does pin 13, but you can look up the nrf51822 reference manual for the other addresses and bits to set for the row pins (although you might also have to set the pin mode).

Code: Select all

    # pin13 = 1
    machine.mem8[0x5000050a] |= 0b10000000
    # pin13 = 0
    machine.mem8[0x5000050e] |= 0b10000000