Go to advanced search

by Mates1774
Wed Feb 22, 2017 8:48 pm
Forum: Python
Topic: [HELP] One button two tasks
Replies: 4
Views: 820

Re: [HELP] One button two tasks

Hello, think there are two areas where your script needs to be improved. One point is the arrangement of code if run == False: os.system("nohup /home/pi/radio.sh &>/dev/null &") time.sleep(4) print() run = True time.sleep(0.2) if run == True: os.system("sudo pkill mplayer") run = False if the first...
by Mates1774
Mon Feb 20, 2017 8:22 pm
Forum: Python
Topic: [HELP] One button two tasks
Replies: 4
Views: 820

[HELP] One button two tasks

import RPi.GPIO as GPIO import time import os GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: input_state = GPIO.input(24) if input_state == False: run = False if run == False: os.system("nohup /home/pi/radio.sh &>/dev/null &") time.sleep(4) print() run = True t...

Go to advanced search