-
Notifications
You must be signed in to change notification settings - Fork 119
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
Reduce code size and memory footprint #46
Comments
I'd definitely be interested in taking a look. |
@rkompass Unfortunately the link above doesn't seem to be working |
Hello Dave, The file lcd_i2c8574.py (my driver) is this:
I'm thinking about adding an option for scrolling text, so that you may almost write like with print() with the difference that after a newline with The above code which imports only time should run on most platforms. A test script ideally would be written so that it queries the platform and then dependent on that instantiates i2c, perhaps queries the presence of devices there.
Thank you for comments. Raul |
The file doesn't appear to be in the referenced repository. |
For that reason I presented the file above. I now found a bug in write() and will try to remove it in the next days (without hurry). After that I will setup the repository again. |
@dhylands @freemansoft |
On the basis of the code here which I gratefully took as a starting point I derived a driver (I2C) which has reduced code size and memory footprint, while somewhat improving functionality. It is here.
Memory consumption went down from 4896 to 1616 bytes.
This was achieved by combining functions and replacing constant variables with their values.
The new version also should be easier for new users, as it is only one file, which probably should run on many platforms.
I would be happy to provide a set of (or a combined) pull request, if you are interested (thx for feedback here).
The same for a version for other interfaces than I2C and a more universal test script.
The text was updated successfully, but these errors were encountered: