I am looking for some guidance on a project that I am doing...
We currently have a alarm panel that arms our building and when we the arm building we want a PA message to play. The way we plan on setting this up is when the Alarm Panel is armed it will send a signal to relay switch that is connected to the pi. The pi will be connected to a amp to play the message across the pa system. I am looking for recommendations on everything. We already have a PI 3 model B 1 ram. We are using python and will attach the code I have programmed thus far. Please let me know what products that we will need and let me know if there is a better way to code.
Thank you in advance for your assistance,
Code: Select all
from gpiozero import Button import pygame pygame.init() btn=Button(17) broadcast=pygame.mixer.Sound('/home/pi/folder/filename.wav') def audio(): print("audio) broadcast.play() btn.when_pressed = audio