Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4873

Python • Re: PID controller help

$
0
0
Are you using something like this? If so, you must declare the variables you plan on using in other functions as global.
In this example, if you want to use done and target_temp in the thread (or any other function) declare them as global.

Code:

def main():  global done, target_temp    while not done:    target_temp = 50   if __name__ == '__main__': main()

Statistics: Posted by SurferTim — Sun Oct 20, 2024 11:21 am



Viewing all articles
Browse latest Browse all 4873

Trending Articles