from gpiozero import LED, MotionSensor
from time import sleep, time
from pygame import mixer
import random

pir = MotionSensor(4)
led_lights = LED(21)
soundnum = 0

print("Starting")

while True:
	pir.wait_for_motion()
	soundnum = random.randint(0,6)
	print("You moved")
	print(soundnum)
	mixer.init()
	mixer.music.load('1.mp3')
	mixer.music.play()
	led_lights.on()
	sleep(1.0)
	led_lights.off()
	sleep(0.5)
	led_lights.on()
	sleep(0.4)
	led_lights.off()
	sleep(0.2)
	led_lights.on()
	sleep(0.8)
	led_lights.off()
	sleep(0.3)
	led_lights.on()
	sleep(0.5)
	led_lights.off()
	pir.wait_for_no_motion()
	print("You no more moved")
