Documentation ¶
Overview ¶
Package makeybutton providers a driver for a button that can be triggered by anything that is conductive by using an ultra high value resistor.
Inspired by the amazing MakeyMakey https://makeymakey.com/
This code is a reinterpretation of https://github.com/sparkfun/MaKeyMaKey/blob/master/firmware/Arduino/makey_makey/makey_makey.ino
Index ¶
Constants ¶
const ( NeverPressed ButtonState = 0 Press = 1 Release = 2 )
const ( NotChanged ButtonEvent = 0 Pressed = 1 Released = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a buffer to keep track of the most recent readings for a button. in bit form.
type Button ¶
type Button struct { HighMeansPressed bool // contains filtered or unexported fields }
Button is a "button"-like device that acts like a MakeyMakey.
func (*Button) Configure ¶
Configure configures the Makey Button pin to have the correct settings to detect touches.
func (*Button) Get ¶
func (b *Button) Get() ButtonEvent
Get returns a ButtonEvent based on the most recent state of the button, and if it has changed by being pressed or released.