Skip to content

Instantly share code, notes, and snippets.

@prcutler
Created June 4, 2021 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prcutler/41735752fec77d0c84b3622db9b27ddf to your computer and use it in GitHub Desktop.
Save prcutler/41735752fec77d0c84b3622db9b27ddf to your computer and use it in GitHub Desktop.
import board
import digitalio
import time
import adafruit_requests as requests
from adafruit_circuitplayground import cp
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
mute_on_button = digitalio.DigitalInOut(board.D4)
mute_off_button = digitalio.DigitalInOut(board.D5)
mute_on = "http://192.168.1.212:8080/goform/formiPhoneAppDirect.xml?Z2MUON"
mute_off = "http://192.168.1.212:8080/goform/formiPhoneAppDirect.xml?Z2MUOFF"
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
if mute_on_button:
requests.get(mute_on)
elif mute_off_button:
requests.get(mute_off)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment