Hi GrovePi enthusiats,
I came across a problem with my dust sensor and wonder whether this is “by design” or a mistake in my code.
A python script accesses the dust sensor through:
[lpo, percent, concentration] = grovepi.dust_sensor_read_more()
From time to time the script hangs while executing this command. I need to close the script and re-run it. During my troubleshooting session I discovered that this problem only exists if the command is executed and in the meantime some other processes perform a command (e.g. digitalWrite(led,1)) to another port.
I have two questions:
1.) Is this by design? I already developed a different solution which takes care that there is no parallel activity ongoing but would like to stick to my “older” approach.
2.) Is there a way to abort the grovepi.dust_sensor_read_more() with a timeout if it fails?