I need a help to stop getCPUtemperature(): function together with robot() function.
def getCPUtemperature():
while True:
res = os.popen('vcgencmd measure_temp').readline()
temp1=int(float(res.replace("temp=","").replace("'C\n","")))
temp2= 9.0/5.0*temp1+32
print temp1,"C", "\n", temp2,"F"
time.sleep(0.5)
if __name__ == '__main__':
try:
#Thread(target = robot).start()
Thread(target = getCPUtemperature).start()
Thread(target = robot).start()
except KeyboardInterrupt:
# CTRL+C exit, turn off the drives and release the GPIO pins
print 'Terminated'
stop_movement()
raw_input("Turn the power off now, press ENTER to continue")
GPIO.cleanup()
quit()strong text