Last active
November 4, 2018 16:30
-
-
Save boochow/59f3c9ac090b92cdb575075b1d112ded 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 machine import SD | |
import os | |
sd = SD() | |
sd.ioctl(1,0) | |
def pr(buf): | |
l=len(buf) | |
c=0 | |
while(c<l): | |
print("%04x:" % c, end='') | |
for i in range(16): | |
print("%02x " % buf[c+i], end='') | |
print(" ", end='') | |
for i in range(16): | |
b = buf[c+i] | |
if b>0x20 and b<0x7f: | |
print(chr(b), end='') | |
else: | |
print('.', end='') | |
print() | |
c += 16 | |
buf=bytearray(512) | |
sd.readblocks(0xbb00,buf) | |
pr(buf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment