Skip to content

Instantly share code, notes, and snippets.

@westy48
Created November 27, 2016 01:36
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 westy48/549dcd0a6116c0f8a27df7dc79beb8b1 to your computer and use it in GitHub Desktop.
Save westy48/549dcd0a6116c0f8a27df7dc79beb8b1 to your computer and use it in GitHub Desktop.
# Import Python libraries
from gpiozero import LED, PWMLED, Button
import pygame.mixer
from pygame.mixer import Sound
import time
from signal import pause
pygame.mixer.init()
santa = Sound("Laugh.wav")
# Set the GPIO pins
led = PWMLED(24)
button = Button(3)
while True:
button.wait_for_press()
led.pulse(n=5)
santa.play()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment