Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func NewArray ¶
Create a new array of pins to be used as touch sensors. The pins do not need to be initialized. The array is immediately ready to use.
By default, NewArray configures a static threshold that is not very sensitive. If you want the touch inputs to be more sensitive, use SetDynamicThreshold.
func (*Array) RawValue ¶
Return the raw value of the given pin index of the most recent call to Update. This value is not smoothed in any way.
func (*Array) SetDynamicThreshold ¶
Use a dynamic threshold (as promille), that will calibrate automatically. This is needed when you want to be able to detect touches through a non-conducting surface for example. Something like 100‰ (10%) will probably work in many cases, though you may need to try different value to reliably detect touches.
func (*Array) SetStaticThreshold ¶
Use a static threshold. This works well on simple touch surfaces where you'll directly touch the metal.
func (*Array) SmoothedValue ¶
Return the value from the moving average. This value is only available when a dynamic threshold has been set, it will panic otherwise.