Simple program written in Go for the JamHat from ModMyPi. The code is meant to be simple and readable to get a basic understanding of how to interace with the JamHat. GPIO pin edge detection was not used for button presses, nor was PWM used to buzz the buzzer.
NOTE: As the buzzer uses GPIO Pin 20, PWM code not be used to make the buzzer buzz, so we just used basic on/off with sleeps.
Product from ModMyPi JAM HAT (LED & Buzzer Board)
Python source code for JamHat https://github.com/modmypi/Jam-HAT
- go get github.com/adrianh-za/go-jamhat-rpi
- browse to $/go/src/github.com/adrianh-za/go-jamhat-rpi
- sudo -E go run main.go
- ctrl-c to quit
This project uses the GPIO library written and maintained by Stian Eikeland
https://github.com/stianeikeland/go-rpio
- Maybe in future use Pin Edge Detection to intercept button press/release events.
- Possibly see if there is a way to use PWM with the buzzer. (software PWM perhaps)