1
0
mirror of https://github.com/MarkParker5/STARK.git synced 2025-01-18 11:12:15 +02:00

Pi smart cooling

This commit is contained in:
MarkParker5 2020-10-31 12:04:13 +02:00
parent f2b54c0e5e
commit 8c5d6215f0

View File

@ -3,14 +3,16 @@ import time
import RPi.GPIO as GPIO
pin = 3
cooling = False
def current_temp():
temp = os.popen("vcgencmd measure_temp").readline()
return temp.replace("temp=","")
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT)
while True:
temp = int(current_temp())
temp = float(current_temp()[:4])
if temp > 55:
cooling = True
elif temp < 40: