I am trying to read the whole FIFO buffer in the lis3dh of the Hannah with 1 single read. The following code:
local tempbuf = i2cPort.read(address, command, number);
returns an error “[Device] ERROR: no memory in i2c.read”
The number of bytes being read “number” is 192 or 32 values of 2 bytes for 3 channels. If I execute the same code but with number of 6, no error comes up.
Any suggestions on the maximum number allowed?
Could it be an issue of the Imp running out of memory, since the overall code is fairly large, about 900 lines.
Well, the error says it all really: it couldn’t allocate a block of “number” bytes. 900 lines is large, but by no means the largest we’ve heard of. Your imp must be right on the edge if it can’t find 192 more bytes. Does it fail this way every time? Are you sure that “number” isn’t accidentally enormous?