Created
May 18, 2019 15:52
-
-
Save rjp44/eba0cadd9b6f835f5c91b999ac2c3786 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
# From https://support.microbit.org/support/solutions/articles/19000070728-how-to-read-the-device-serial-number | |
def get_serial_number(): | |
NRF_FICR_BASE = 0x10000000 | |
DEVICEID_INDEX = 25 # deviceid[1] | |
@micropython.asm_thumb | |
def reg_read(r0): | |
ldr(r0, [r0, 0]) | |
return reg_read(NRF_FICR_BASE + (DEVICEID_INDEX*4)); | |
display.scroll(get_serial_number()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment