Hi everyone
I’m running a collection of environmental sensors and an i2c touch controller (with 4 touch sensors) on my GrovePi.
First of all, the i2c touch demo program (touchtest.py) requires sudo to run, is this correct? I’m using Raspian and the default “pi” user.
Secondly, when I copy the demo code in my own program (and run as sudo to make it work), it somehow manages to interrupt certain sensors, making the try: return always fail.
The sensors which fail are:
Air quality (analogRead)
Loudness (analogRead)
Temperature & Humidity (dht)
The ones which still work are:
Pressure (bmp.readPressure())
Barometer temperature (bmp.readTemperature())
Lux (complex but I’m using digital_light_lux())
Motion (digitalRead)
I should point out that the loops to listen to the touch sensor and get the sensor data are running on different threads.
The strangest thing is that the problem remains until the Pi is shutdown and restarted again.
Does anyone have any ideas of why this may be happening? Or a different way of using the i2c touch in Python?
Thanks
James
EDIT:
This might be a deeper issue:
I’m now trying to use a simple button instead of the i2c touch sensors, and whenever the motion sensor is detecting motion, the button is being returned as pressed. They are definitely set up on different digital ports in Python. I’ve tried moving the button to a different port with no luck. I think it’s also causing an issue with the temp & humidity sensors on port D7.