whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.18k stars 221 forks source link

fix i2c bug #312

Closed the0ne closed 4 years ago

the0ne commented 4 years ago

this fixes #296 where multiple :read() commands lead to additional bytes on the i2c bus

fixed by providing additional length parameter (max 128) to the read function so the user can now specify the number of bytes to read - each byte that has been read is returned as integer value by default

on request also added an optional parameter (boolean) to return the data as a string

xopxe commented 4 years ago

Does this affect existing code? Can it be merged safely?

the0ne commented 4 years ago

Does not affect existing Lua Code. But existing Code with multiple read commands triggers too high number of bytes on the bus so that it should probably be updated anyway ;-)