TLDR: What's the easiest way of interacting with a Phidget from inside another Phidget's event handler?
Me again, still working on the injection molding machine. The stepper motors are working great now thanks to the help I got on a previous post.
I want to regulate the temperature of the extruder using a thermocouple and four 40W cartridge heaters. I'm going to try to keep it simple for now: when the thermocouple notices a temperature change event, it checks to see if its below or above a global target temperature variable. From there, I'd like to be able to turn the heaters on or off, but I'm not sure how I can command the heaters in the temperature change handler because they were defined in a different scope. I'd prefer not to have to connect to the heaters every time I want to change them inside of the event handler. I have tried changing a global "is_heating" variable to "True", which works, but then I have to poll that value throughout the code to achieve any kind of update speed. Is there a more effective way of doing this?