You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2019. It is now read-only.
It looks like there's code to read the i2c bus and keep the results for future calls to joystick, acceleration, and buttons. However, the button code doesn't seem to update the buffer.
It looks like it would be possible to make fewer reads and improve performance. Here's my suggestion....
Add an optional parameter to the init() that takes a maxAge parameter (default to .1sec?).
In __read_data() keep track of whether it's been over maxAge since the last read. If not use the current buffer. If you do a read, update the last read time
If maxAge is set to zero, then it would always fetch on every read.
If maxAge is set to -1 then the data read calls would never call read_data: the user would need to call a public method (read_data()?) to fetch the data.
I think that would give full control to the clients of the library.