Issue Reading from I2C Register #10563
Answered
by
peterhinch
sageduggal
asked this question in
Using MicroPython
-
Hello there, I am attempting to write to a specific register, however when I check the register after writing, I am getting an odd output. i2c.writeto_mem(i2caddress, PWR_MGMT_1, bytearray([0b00000000]))
print(i2c.readfrom_mem(i2caddress, PWR_MGMT_1, 1))
i2c.writeto_mem(i2caddress, PWR_MGMT_1, bytearray([0b00101000]))
print(i2c.readfrom_mem(i2caddress, PWR_MGMT_1, 1)) The first print output is correct: b'\x00' The second one, however, I do not understand: b'(' Has anyone experienced this before? I must be doing something wrong but not sure what is going on. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
peterhinch
Jan 23, 2023
Replies: 1 comment 2 replies
-
The '(' character corresponds to 0x28 (try |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
sageduggal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The '(' character corresponds to 0x28 (try
hex(ord(b'('))
). Is this an unreasonable response?