Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FourWire ¶
type FourWire struct {
// contains filtered or unexported fields
}
FourWire represents a resistive touchscreen with a four-wire interface as described in http://ww1.microchip.com/downloads/en/Appnotes/doc8091.pdf
func (*FourWire) Configure ¶
func (res *FourWire) Configure(config *FourWireConfig) error
Configure should be called once before starting to read the device
func (*FourWire) ReadTouchPoint ¶
ReadTouchPoint reads a single touch.Point from the device. If the device was configured with ReadSamples > 1, each value will be sampled that many times and averaged to smooth over spurious results of the analog reads.
type FourWireConfig ¶
type FourWireConfig struct { // Y+ pin, must be capable of analog reads YP machine.Pin // Y- pin, must be capable of analog reads YM machine.Pin // X+ pin, must be capable of analog reads XP machine.Pin // X- pin, must be capable of analog reads XM machine.Pin // If set, each call to ReadTouchPoint() will sample the X, Y, and Z values // and average them. This can help smooth out spurious readings, for example // ones that result from the capacitance of a TFT under the touchscreen ReadSamples int }
FourWireConfig is passed to the Configure method. All of the pins must be specified for this to be a valid configuration. ReadSamples is optional, and if not set with default to 2.
Click to show internal directories.
Click to hide internal directories.