Comments (11)
The area of interest for this problem is the interrupt polling loop here: https://github.com/pimoroni/cap1xxx/blob/master/library/cap1xxx.py#L360-L371
I suspect that delay needs increasing- in fact there must be a minimum sensible time for it which I could look up or derive. I kept it low because I wanted a good response in Piano HAT, but never tried raising it.
Piano HAT uses the alert pins, however, so the GPIO read is way less expensive than the round trip to an i2c register that the library needs to make for DotHAT.
from displayotron.
I've updated cap1xxx to increase the delay from a microsecond ( completely bonkers and probably not even meaningful in Python ) to 5ms, which I think should be plenty fast enough for even Piano HAT. pimoroni/cap1xxx-python@ef34015
If you grab the cap1xxx library from GitHub and install it, hopefully your CPU usage will drop dramatically.
from displayotron.
Cool.
Will re-running the dot3k installation script update the cap1xxx library?
I'll take a look at it ASAP. ;-)
from displayotron.
Nope, you'd have to git clone the cap1xxx library and install that separately.
from displayotron.
Ah, okay.
Maybe a stupid question, but where and how do I install it?
Also, since other Display-O-Tron HAT owners might not be aware of the CPU usage, you might want to make sure that re-running the dot3k installation script also updates the cap1xxx library. ;-)
from displayotron.
Under normal circumstances it should go, but I haven't pushed the change up to pip yet. Try something like:
git clone https://github.com/pimoroni/cap1xxx
cd cap1xxx/library
sudo python setup.py install
sudo python3 setup.py install
from displayotron.
I was wondering, is this issue solved in the official installation? I still have CPU usage around 20% with active dothat.touch event handlers, but it could also be my crappy Python code š
from displayotron.
Issue still exists.
from displayotron.
I've pushed up version 0.1.1 to pip which should contain this fix: https://pypi.python.org/pypi/Cap1xxx
Would be interested in feedback! @capfuji @wujku
from displayotron.
Thanks! CPU usage is down from around 20 to 2.3 %. Touch buttons are still working as expected. Perfect š
from displayotron.
I guess this issue can be closed. Good work!
from displayotron.
Related Issues (20)
- [Suggestion] A class for "tables" HOT 6
- pip install does not install current version HOT 1
- Error installing examples HOT 1
- PermissionError when using without root/sudo HOT 3
- [Request] New line with ā\nā
- class for the breakout HOT 2
- Node-Red integration HOT 1
- How can I reference an individual LED on dothat? HOT 3
- Python 3 inputs HOT 1
- Install one-liner not fetching up-to-date examples HOT 2
- Experimental support warning with Raspbian Stretch HOT 3
- Default contrast value for Display-O-Tron HAT HOT 1
- Displayotron HAT No Response - Blank Screen - Under many circumstances HOT 2
- Allow rainbow colours in radio
- Use on RTk GPIO
- Can we use this library on bullseye? HOT 8
- AttributeError: 'AsyncWorker' object has no attribute 'isAlive' HOT 5
- Issue when running game.py example (Python 3.9.2)
- install script: '301 Moved Permanently'
- Does not install with pip and sudo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from displayotron.