adrianh-za / go-jamhat-rpi

Simple program written in Go for the JamHat from ModMyPi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go-JamHat-RPi

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

Usage

  1. go get github.com/adrianh-za/go-jamhat-rpi
  2. browse to $/go/src/github.com/adrianh-za/go-jamhat-rpi
  3. sudo -E go run main.go
  4. ctrl-c to quit

Acknowledgements

This project uses the GPIO library written and maintained by Stian Eikeland

Gits

https://github.com/stianeikeland/go-rpio

TODO

  • 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)

About

Simple program written in Go for the JamHat from ModMyPi.

License:MIT License


Languages

Language:Go 100.0%