I want to read more than 32 bytes from the Wire library. In the reference I see mention of acquireWireBuffer() to create a config with a larger buffer, but I don’t see how to use that. How do I pass that struct into Wire? Or perhaps I’m not understanding this at all?
Hi,
- copy the entire example from here:
acquireWireBuffer - Wire (I2C) | Reference | Particle to your sketch - set
constexpr size_t I2C_BUFFER_SIZE
to whatever size you need e.g.: 64 - in
setup
callacquireWireBuffer();
thenhal_i2c_init(HAL_I2C_INTERFACE1, &config)
; (if you are using Wire interface) and the last oneMY_I2C_DEV.begin();
- Make sure that the Lib. which you are using with your I2C_dev doesn’t define somewhere in header the buffers size, if this is the case change it as well to correct size.
Hope that will help
Best,
2 Likes
This worked great. I used it to connect the person sensor from Sparkfun https://www.sparkfun.com/products/21231
Their supplied code does not work:
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.