-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i2c device memory operations #682
Comments
No there is no plan to add those operations. But it's possible to do memory operations with the existing 2 methods, eg: def read_mem(i2c, addr, mem_addr):
i2c.write(addr, bytes([mem_addr]), True)
return i2c.read(addr, 1)[0] |
Hi
Microbit works well with the BME280 but the computationally heavy code takes much of its memory. Hope this snippet written for the BME280 helps:
# Discover if the sensor is there
# IDAddress = bytearray(1)
# IDAddress[0] = 0xD0# i2c.write(0x77, IDAddress, repeat = False)
# id = i2c.read(0x77, 1, repeat = False)
# print(id)
Best wishes => Terry
On Saturday, 29 August 2020, 8:19:53 am NZST, ozanoner <[email protected]> wrote:
Hi,
Is there any plan to add i2c device memory operations? as here:
https://docs.micropython.org/en/latest/library/machine.I2C.html#machine.I2C.readfrom_mem
I tried to use BME280 however the driver requires access to its internal registers. one example here:
https://randomnerdtutorials.com/micropython-bme280-esp32-esp8266/
Regards,
Ozan
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I am running into serious problems trying to get an MPU6500 to work for similar reasons. On a raspbery pi it works immediately, but trying to get this chip going on the microbit with the web-based python editor I see that for starters I need to do +1 on all the writes writes for the register number, only then I can read the who_am_i register correctly. Trying to read the gyro and accel registers gives me data that suggests that the registers are somehow swapped. Is there any point in trying to checkout this repository and run the updates manually? |
Hi,
Is there any plan to add i2c device memory operations? as here:
https://docs.micropython.org/en/latest/library/machine.I2C.html#machine.I2C.readfrom_mem
I tried to use BME280 however the driver requires access to its internal registers. one example here:
https://randomnerdtutorials.com/micropython-bme280-esp32-esp8266/
Regards,
Ozan
The text was updated successfully, but these errors were encountered: