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:
parent
f2b54c0e5e
commit
8c5d6215f0
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user