Posts

Showing posts from January 25, 2019

Turn the fan on 10 scs long python

Image
0 This is my code turning the fan on i run the sleep on separate thread because it makes the entire script sleep def fan_on(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) FAN_PIN = 23 GPIO.setup(FAN_PIN,GPIO.OUT) GPIO.output(FAN_PIN,True) t = Thread(target=sleep_fan) t.deamon = True t.start() def sleep_fan(): time.sleep(10) The script is running however im not getting 10 scs it is only 1 or 2 seconds? How to fix this? TIA python python-3.x python-2.7 gpio share | improve this question asked Nov 25 '18 at 7:20 Beginner Beginner 262 2 10