Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Calibrated[Min|Max]AI was calculated using the EuroPi calibration program: // https://github.com/Allen-Synthesis/EuroPi/blob/main/software/programming_instructions.md#calibrate-the-module CalibratedMinAI = 384 CalibratedMaxAI = 44634 DefaultSamples = 1000 )
View Source
const ( OLEDFreq = machine.TWI_FREQ_400KHZ OLEDAddr = 0x3C OLEDWidth = 128 OLEDHeight = 32 )
View Source
const ( MaxVoltage = 10.0 MinVoltage = 0.0 )
View Source
const ( // Manually calibrated to best match expected voltages. Additional info: // https://github.com/Allen-Synthesis/EuroPi/blob/main/software/programming_instructions.md#calibrate-the-module CalibratedOffset = 32 // The default PWM Top of MaxUint16 caused noisy output. Dropping this down to a 12bit value resulted in much smoother cv output. CalibratedTop = 0xfff - CalibratedOffset )
Variables ¶
View Source
var ( DefaultChannel = machine.I2C0 DefaultFont = &proggy.TinySZ8pt7b White = color.RGBA{255, 255, 255, 255} )
View Source
var DefaultDebounceDelay time.Duration
Functions ¶
Types ¶
type AnalogInput ¶
func NewAI ¶
func NewAI(pin machine.Pin) *AnalogInput
func (*AnalogInput) Percent ¶
func (a *AnalogInput) Percent() float32
func (*AnalogInput) Range ¶
func (a *AnalogInput) Range(steps int) int
func (*AnalogInput) ReadVoltage ¶
func (a *AnalogInput) ReadVoltage() float32
func (*AnalogInput) Samples ¶
func (a *AnalogInput) Samples(samples int)
type AnalogReader ¶
type DigitalInput ¶
func NewDI ¶
func NewDI(pin machine.Pin) *DigitalInput
func (*DigitalInput) Handler ¶
func (d *DigitalInput) Handler(handler func(p machine.Pin))
func (*DigitalInput) LastInput ¶
func (d *DigitalInput) LastInput() time.Time
func (*DigitalInput) Value ¶
func (d *DigitalInput) Value() bool
type DigitalReader ¶
type EuroPi ¶
type EuroPi struct { DI DigitalReader AI AnalogReader // Display is a wrapper around ssd1306.Device Display *Display B1 DigitalReader B2 DigitalReader K1 AnalogReader K2 AnalogReader CV1 Outputer CV2 Outputer CV3 Outputer CV4 Outputer CV5 Outputer CV6 Outputer }
type Knob ¶
func (*Knob) ReadVoltage ¶
type PWMer ¶
type PWMer interface { Configure(config machine.PWMConfig) error Channel(pin machine.Pin) (channel uint8, err error) Top() uint32 SetTop(top uint32) Get(channel uint8) (value uint32) Set(channel uint8, value uint32) SetPeriod(period uint64) error }
PWMer is an interface for interacting with a machine.pwmGroup
Source Files ¶
Click to show internal directories.
Click to hide internal directories.