rotate_mode
It be nice for me at least to see all the readings. So I add a rotate_mode like proximity. Anything > 0 enables it, default is 10 seconds for me.
diff --git a/examples/all-in-one-no-pm.py b/examples/all-in-one-no-pm.py
index 6bb6873..100cf9e 100755
--- a/examples/all-in-one-no-pm.py
+++ b/examples/all-in-one-no-pm.py
@@ -101,6 +101,7 @@ factor = 0.8
cpu_temps = [get_cpu_temperature()] * 5
delay = 0.5 # Debounce the proximity tap
+rotate_mode = 10 # seconds between screen mode rotate
mode = 0 # The starting mode
last_page = 0
light = 1
@@ -130,6 +131,12 @@ try:
mode %= len(variables)
last_page = time.time()
+ # If time elapsed > rotate_mode, show next mode
+ if rotate_mode > 0 and time.time() - last_page > rotate_mode:
+ mode += 1
+ mode %= len(variables)
+ last_page = time.time()
+
# One mode for each variable
if mode == 0:
# variable = "temperature"
This is a good idea- thank you!
Only problems it after awhile it does crash with
Traceback (most recent call last):
File "all-in-one-no-pm.py", line 126, in
and I know nothing about Python .. :/~
That's odd- I can't see anything in update_sensor ( in the ltr559 library ) that should ever throw a tuple index error.
What do you see if you run:
python -c "import ltr559;print(ltr559.__version__)"
Or, alternatively:
pip show ltr559
pi@raspberrypi:~ $ python -c "import ltr559;print(ltr559.version)" 0.1.0 pi@raspberrypi:~ $ pip show ltr559 Name: ltr559 Version: 0.1.0 Summary: Python library for the LTR559 light and proximity Home-page: http://www.pimoroni.com Author: Philip Howard Author-email: [email protected] License: MIT Location: /usr/local/lib/python2.7/dist-packages/ltr559-0.1.0-py2.7.egg Requires: i2cdevice Required-by: enviroplus pi@raspberrypi:~ $
In retrospect that should have been obvious by the fact ltr559-0.1.0 was right there in your original comment! Sometimes I can't see the wood for the trees.
I can't see any reason- at a glance- why that error would crop up. I'll run some tests.