[Tutor] Thread Object integration with GPIO

2017-04-30 Thread Marc Eymard
Hello there, I have hooked up an ultrasonic sensor to my Raspberry Pi-enabled robot in order to get continuous distance-to-obstacle reading. The sensor is properly connected via GPIO and already reads the distance properly when running a simple script. However, I need to integrate the sensor rea

Re: [Tutor] Thread Object integration with GPIO

2017-04-30 Thread Steven D'Aprano
On Sat, Apr 29, 2017 at 06:26:28PM +, Marc Eymard wrote: > The way I have decided to go about implementing the sensor reading is by > creating a Thread object and update the distance attribute of this very > same object from the run() function. The idea is to encapsulate the > distance read

Re: [Tutor] Thread Object integration with GPIO

2017-04-29 Thread boB Stepp
On Sat, Apr 29, 2017 at 1:26 PM, Marc Eymard wrote: > Hello there, > Attached the script I have come up with, which keeps returning multiple > run time errors whenever I try to fix it. > I believe there are multiple issues, but at least it gives an idea of > what I currently want to achieve and h

[Tutor] Thread Object integration with GPIO

2017-04-29 Thread Marc Eymard
Hello there, I have hooked up an ultrasonic sensor to my Raspberry Pi-enabled robot in order to get continuous distance-to-obstacle reading. The sensor is properly connected via GPIO and already reads the distance properly when running a simple script. However, I need to integrate the sensor r