24 lines
684 B
Python
24 lines
684 B
Python
#https://www.deviceplus.com/how-tos/add-siri-control-raspberry-pi-project/
|
||
|
||
#You can import any modules required here
|
||
import RPi.GPIO as GPIO #import GPIO module
|
||
import time
|
||
|
||
#This is name of the module – it can be anything you want
|
||
moduleName = “LED_off”
|
||
|
||
#These are the words you must say for this module to be executed
|
||
commandWords = [“turn”, “off”, “led”]
|
||
|
||
#This is the main function which will be execute when the above command words are said
|
||
def execute(command):
|
||
LED = 11 # Set LED pin to pin 11
|
||
|
||
GPIO.setmode(GPIO.BOARD)
|
||
GPIO.setup(LED, GPIO.OUT) #configure LED as an output
|
||
|
||
print(“\n”)
|
||
print(“LED is off.”)
|
||
GPIO.output(LED, GPIO.LOW) #turn LED on
|
||
|