diff --git a/api/cammie.go b/api/cammie.go index 2e36dc1..94b6f66 100644 --- a/api/cammie.go +++ b/api/cammie.go @@ -3,6 +3,7 @@ package api import ( "fmt" "net/http" + "scc/buzzer" "scc/config" "scc/screen" "slices" @@ -77,6 +78,7 @@ func cammiePostMessage(app *screen.ScreenApp, c *gin.Context) { cammieMessages++ app.Cammie.Update(newMessage) + go buzzer.PlayBuzzer() c.JSON(http.StatusOK, gin.H{"message": "Message received"}) } diff --git a/buzzer/buzzer.go b/buzzer/buzzer.go index eef8226..ffb2299 100644 --- a/buzzer/buzzer.go +++ b/buzzer/buzzer.go @@ -12,7 +12,7 @@ var buzzerOptions = map[string]func(rpio.Pin){ "default": playMusic, } -func playBuzzer() { +func PlayBuzzer() { err := rpio.Open() if err != nil { log.Printf("Error: Unable to open pin: %s", err)