Documentation
¶
Overview ¶
Core Electronics PiicoDev Buzzer The Python and firmware implementations: https://github.com/CoreElectronics/CE-PiicoDev-Buzzer-MicroPython-Module
Core Electronics PiicoDev Capacitive Touch Sensor CAP1203 Spec sheet: https://ww1.microchip.com/downloads/en/DeviceDoc/00001572B.pdf
Core Electronics PiicoDev Air Quality Sensor ENS160 ¶
I2C device access through the Linux /dev/i2c-{bus} for Piicodev devices
Core Electronics PiicoDev Motion Sensor MPU-6050 ¶
Core Electronics PiicoDev Pressure Seneor MS5637 The original C implementation is https://github.com/TEConnectivity/MS5637_Generic_C_Driver
Core Electronics PiicoDev Potentiometer ¶
SparkFun Electronics Qwiic PIR The firmware: https://github.com/sparkfun/Qwiic_PIR The Python implementation: https://github.com/sparkfun/Qwiic_PIR_Py
Core Electronics PiicoDev RGB LED The Python and firmware implementations: https://github.com/CoreElectronics/CE-PiicoDev-RGB-LED-MicroPython-Module
Core Electronics PiicoDev Switch ¶
Core Electronics PiicoDev Precision Temperature Sensor TMP117 ¶
Core Electronics PiicoDev Ambient Light Sensor VEML6030 Spec sheet: https://www.vishay.com/docs/84366/veml6030.pdf
Core Electronics PiicoDev Colour Sensor VEML6040 Spec sheet: https://www.vishay.com/docs/84331/designingveml6040.pdf
Core Electronics PiicoDev Distance Sensor VL53L1X
Index ¶
- Constants
- func CalculateCCT(red, green, blue uint16) (cct float64)
- func CalculateHSV(red, green, blue uint16) (hue, saturation, value float64)
- type AHT10
- type Buzzer
- func (b *Buzzer) Close()
- func (b *Buzzer) EnablePowerLED(state bool) (err error)
- func (b *Buzzer) GetDeviceID() (id byte, err error)
- func (b *Buzzer) GetFirmwareVersion() (ver [2]byte, err error)
- func (b *Buzzer) GetStatus() (status byte, err error)
- func (b *Buzzer) NoTone() (err error)
- func (b *Buzzer) SetTone(freq uint16, duration uint16) (err error)
- func (b *Buzzer) SetVolume(volume int) (err error)
- type CAP1203
- func (c *CAP1203) Close()
- func (c *CAP1203) GetMultipleTouchEnabled() (enabled bool, err error)
- func (c *CAP1203) GetSensitivity() (sensitivity int, err error)
- func (c *CAP1203) IsTouched() (touched bool, err error)
- func (c *CAP1203) Read() (status1, status2, status3 bool, err error)
- func (c *CAP1203) ReadDeltaCounts() (count1, count2, count3 int, err error)
- func (c *CAP1203) SetMultipleTouchEnabled(enabled bool) (err error)
- func (c *CAP1203) SetSensitivity(sensitivity int) (err error)
- type ENS160
- func (s *ENS160) Close()
- func (s *ENS160) GetHumidity() (humidity float64, err error)
- func (s *ENS160) GetOperation() (operation string, err error)
- func (s *ENS160) GetStatus() (status byte, err error)
- func (s *ENS160) GetTemperature() (temperature float64, err error)
- func (s *ENS160) ReadAQI() (aqi byte, rating string, err error)
- func (s *ENS160) ReadECO2() (eco2 uint16, rating string, err error)
- func (s *ENS160) ReadTVOC() (tvoc uint16, err error)
- func (s *ENS160) SetHumidity(humidity float64) (err error)
- func (s *ENS160) SetTemperature(temperature float64) (err error)
- type I2C
- func (i2c *I2C) Close()
- func (i2c *I2C) ReadReg(reg byte, length int) (val []byte, err error)
- func (i2c *I2C) ReadReg16(reg uint16, length int) (val []byte, err error)
- func (i2c *I2C) ReadReg16U16BE(reg uint16) (val uint16, err error)
- func (i2c *I2C) ReadReg16U16LE(reg uint16) (val uint16, err error)
- func (i2c *I2C) ReadReg16U8(reg uint16) (val byte, err error)
- func (i2c *I2C) ReadRegBit(reg byte, bitPos uint) (val bool, err error)
- func (i2c *I2C) ReadRegBits(reg byte, bitPos uint, numBits uint) (val int, err error)
- func (i2c *I2C) ReadRegS16BE(reg byte) (val int16, err error)
- func (i2c *I2C) ReadRegU16BE(reg byte) (val uint16, err error)
- func (i2c *I2C) ReadRegU16LE(reg byte) (val uint16, err error)
- func (i2c *I2C) ReadRegU24BE(reg byte) (val uint32, err error)
- func (i2c *I2C) ReadRegU32LE(reg byte) (val uint32, err error)
- func (i2c *I2C) ReadRegU8(reg byte) (val byte, err error)
- func (i2c *I2C) Write(val []byte) (err error)
- func (i2c *I2C) WriteReg(reg byte, val []byte) (err error)
- func (i2c *I2C) WriteReg16(reg uint16, val []byte) (err error)
- func (i2c *I2C) WriteReg16U16BE(reg uint16, val uint16) (err error)
- func (i2c *I2C) WriteReg16U16LE(reg uint16, val uint16) (err error)
- func (i2c *I2C) WriteReg16U8(reg uint16, val byte) (err error)
- func (i2c *I2C) WriteRegBit(reg byte, bitPos uint, val bool) (err error)
- func (i2c *I2C) WriteRegBits(reg byte, bitPos uint, numBits uint, val int) (err error)
- func (i2c *I2C) WriteRegU16BE(reg byte, val uint16) (err error)
- func (i2c *I2C) WriteRegU16LE(reg byte, val uint16) (err error)
- func (i2c *I2C) WriteRegU8(reg byte, val byte) (err error)
- func (i2c *I2C) WriteU8(val byte) (err error)
- type LM75A
- type MPU6050
- func (t *MPU6050) Close()
- func (t *MPU6050) GetAccelRangeRaw() (r MPU6050AccelRange, err error)
- func (t *MPU6050) GetAccelRangeValue() (r int, err error)
- func (t *MPU6050) GetGyroRangeRaw() (r MPU6050GyroRange, err error)
- func (t *MPU6050) GetGyroRangeValue() (r int, err error)
- func (t *MPU6050) ReadAccelData() (x, y, z float64, err error)
- func (t *MPU6050) ReadGyroData() (x, y, z float64, err error)
- func (t *MPU6050) ReadTemperature() (tempC float64, err error)
- func (t *MPU6050) SetAccelRange(r MPU6050AccelRange) (err error)
- func (t *MPU6050) SetGyroRange(r MPU6050GyroRange) (err error)
- type MPU6050AccelRange
- type MPU6050GyroRange
- type MS5637
- type MS5637ADCParams
- type Potentiometer
- func (s *Potentiometer) Close()
- func (s *Potentiometer) GetLED() (v uint8, err error)
- func (s *Potentiometer) GetType() int
- func (s *Potentiometer) ReadFirmwareVersion() (major uint8, minor uint8, err error)
- func (s *Potentiometer) ReadRawValue() (v uint16, err error)
- func (s *Potentiometer) ReadValue() (v float64, err error)
- func (s *Potentiometer) SelfTest() (v uint8, err error)
- func (s *Potentiometer) SetLED(enable bool) (err error)
- func (s *Potentiometer) SetMaximum(maximum float64)
- func (s *Potentiometer) SetMinimum(minimum float64)
- type QwiicPIR
- func (p *QwiicPIR) ClearEventBits() (err error)
- func (p *QwiicPIR) Close()
- func (p *QwiicPIR) GetDebounceEvents() (available bool, detected bool, removed bool, err error)
- func (p *QwiicPIR) GetDebounceTime() (debounceTime uint16, err error)
- func (p *QwiicPIR) GetDeviceID() (id byte, err error)
- func (p *QwiicPIR) GetFirmwareVersion() (ver [2]byte, err error)
- func (p *QwiicPIR) GetRawReading() (detected bool, err error)
- func (p *QwiicPIR) IsAvailable() (available bool, err error)
- func (p *QwiicPIR) IsDetectedQueueEmpty() (empty bool, err error)
- func (p *QwiicPIR) IsDetectedQueueFull() (full bool, err error)
- func (p *QwiicPIR) IsObjectDetected() (detected bool, err error)
- func (p *QwiicPIR) IsRemovedQueueEmpty() (empty bool, err error)
- func (p *QwiicPIR) IsRemovedQueueFull() (full bool, err error)
- func (p *QwiicPIR) IstObjectRemoved() (removed bool, err error)
- func (p *QwiicPIR) PopDetectedQueue() (firstDetect uint32, err error)
- func (p *QwiicPIR) PopRemoveQueue() (firstDetect uint32, err error)
- func (p *QwiicPIR) SetDebounceTime(debounceTime uint16) (err error)
- func (p *QwiicPIR) TimeSinceFirstDetect() (firstDetect uint32, err error)
- func (p *QwiicPIR) TimeSinceFirstRemove() (firstDetect uint32, err error)
- func (p *QwiicPIR) TimeSinceLasRemove() (lastDetect uint32, err error)
- func (p *QwiicPIR) TimeSinceLastDetect() (lastDetect uint32, err error)
- type RGBLED
- func (l *RGBLED) Clear() (err error)
- func (l *RGBLED) ClearPixels()
- func (l *RGBLED) Close()
- func (l *RGBLED) EnablePowerLED(state bool) (err error)
- func (l *RGBLED) FillPixels(red, green, blue byte)
- func (l *RGBLED) GetDeviceID() (id byte, err error)
- func (l *RGBLED) GetFirmwareVersion() (ver uint16, err error)
- func (l *RGBLED) SetBrightness(b byte) (err error)
- func (l *RGBLED) SetPixel(num int, red, green, blue byte)
- func (l *RGBLED) Show() (err error)
- type Switch
- func (s *Switch) Close()
- func (s *Switch) GetDebounceEMAParameters() (parameter uint8, period uint8, err error)
- func (s *Switch) GetDoublePressDuration() (duration uint16, err error)
- func (s *Switch) GetLED() (v uint8, err error)
- func (s *Switch) GetPressCount() (count int, err error)
- func (s *Switch) IsPressed() (pressed bool, err error)
- func (s *Switch) ReadFirmwareVersion() (major uint8, minor uint8, err error)
- func (s *Switch) SetDebounceEMAParameters(parameter uint8, period uint8) (err error)
- func (s *Switch) SetDoublePressDuration(duration uint16) (err error)
- func (s *Switch) SetLED(enable bool) (err error)
- func (s *Switch) WasDoublePressed() (doublePressed bool, err error)
- func (s *Switch) WasPressed() (pressed bool, err error)
- type TMP117
- type VEML6030
- func (l *VEML6030) Close()
- func (l *VEML6030) DisablePowerSave() (err error)
- func (l *VEML6030) EnablePowerSave() (err error)
- func (l *VEML6030) GetGainRaw() (gain VEML6030Gain, err error)
- func (l *VEML6030) GetGainValue() (gain float64, err error)
- func (l *VEML6030) GetIntegrationTimeRaw() (integTime VEML6030IntegrationTime, err error)
- func (l *VEML6030) GetIntegrationTimeValue() (integTime uint16, err error)
- func (l *VEML6030) GetPowerSave() (enabled bool, err error)
- func (l *VEML6030) PowerOn() (err error)
- func (l *VEML6030) Read() (light float64, err error)
- func (l *VEML6030) SetGain(gain VEML6030Gain) (err error)
- func (l *VEML6030) SetIntegrationTime(integTime VEML6030IntegrationTime) (err error)
- func (l *VEML6030) Shutdown() (err error)
- type VEML6030Gain
- type VEML6030IntegrationTime
- type VEML6040
- type VL53L1X
Constants ¶
const ( BuzzerStatusReg = 0x01 BuzzerFirmwareVersionMajorReg = 0x02 BuzzerFirmwareVersionMinorReg = 0x03 BuzzerI2CAddressReg = 0x04 BuzzerToneReg = 0x05 BuzzerVolumeReg = 0x06 BuzzerPowerLEDReg = 0x07 BuzzerDeviceIDReg = 0x11 )
const ( CAP1203MainControlReg = 0x00 CAP1203MainControlBitInt = 0 CAP1203GeneralStatusReg = 0x02 CAP1203InputStatusReg = 0x03 CAP1203Input1DeltaCountReg = 0x10 CAP1203Input2DeltaCountReg = 0x11 CAP1203Input3DeltaCountReg = 0x12 CAP1203SensitivityControlReg = 0x1F CAP1203SensitivityControlBitDeltaSense = 4 CAP1203MultipleTouchConfigReg = 0x2A CAP1203ProdIDReg = 0xFD CAP1203ProdIDValue = 0x6D )
const ( I2C_SLAVE uintptr = 0x0703 I2C_RDWR uintptr = 0x0707 )
const ( MPU6050Address = 0x68 GRAVITIY_MS2 = 9.80665 // Scale Modifiers ACC_SCLR_2G = 16384.0 ACC_SCLR_4G = 8192.0 ACC_SCLR_8G = 4096.0 ACC_SCLR_16G = 2048.0 GYR_SCLR_250DEG = 131.0 GYR_SCLR_500DEG = 65.5 GYR_SCLR_1000DEG = 32.8 GYR_SCLR_2000DEG = 16.4 // MPU-6050 Registers PWR_MGMT_1 = 0x6B PWR_MGMT_2 = 0x6C SELF_TEST_X = 0x0D SELF_TEST_Y = 0x0E SELF_TEST_Z = 0x0F SELF_TEST_A = 0x10 ACCEL_XOUT0 = 0x3B ACCEL_XOUT1 = 0x3C ACCEL_YOUT0 = 0x3D ACCEL_YOUT1 = 0x3E ACCEL_ZOUT0 = 0x3F ACCEL_ZOUT1 = 0x40 TEMP_OUT0 = 0x41 TEMP_OUT1 = 0x42 GYRO_XOUT0 = 0x43 GYRO_XOUT1 = 0x44 GYRO_YOUT0 = 0x45 GYRO_YOUT1 = 0x46 GYRO_ZOUT0 = 0x47 GYRO_ZOUT1 = 0x48 ACCEL_CONFIG = 0x1C GYRO_CONFIG = 0x1B )
const ( QwiicPIRAddress = 0x12 QwiicPIRDeviceIDReg = 0x00 QwiicPIRFirmwareVersionMajorReg = 0x01 QwiicPIRFirmwareVersionMinorReg = 0x02 QwiicPIREventStatusReg = 0x03 QwiicPIRInterruptConfigReg = 0x04 QwiicPIREventDebounceTimeReg = 0x05 QwiicPIRDetectedQueueStatusReg = 0x07 QwiicPIRDetectedQueueFrontReg = 0x08 QwiicPIRDetectedQueueBackReg = 0x0C QwiicPIRRemovedQueueStatusReg = 0x10 QwiicPIRRemovedQueueFrontReg = 0x11 QwiicPIRRemovedQueueBackReg = 0x15 QwiicPIRI2cAddressReg = 0x19 QwiicPIRDeviceID = 0x72 )
const ( RGBLEDDeviceIDReg = 0x00 RGBLEDFirmwareVersionReg = 0x01 RGBLEDControlReg = 0x03 RGBLEDClearReg = 0x04 RGBLEDBrightnessReg = 0x06 RGBLEDValuesReg = 0x07 )
const ( VEML6040Address = 0x10 VEML6040ConfigReg = 0x00 VEML6040RedReg = 0x08 VEML6040GreenReg = 0x09 VEML6040BlueReg = 0x0A VEML6040WhiteReg = 0x0B VEML6040DefaultSettings = 0x00 // initialise gain:1x, integration 40ms, Green Sensitivity 0.25168, Max. Detectable Lux 16496, No Trig, Auto mode, enabled. VEML6040Shutdown = 0x01 )
const (
AHT10Address = 0x38
)
const BuzzerAddress = 0x5C
const CAP1203Address = 0x28
const (
ENS160Address = 0x53
)
const (
LM75AAddress = 0x4F
)
const (
MS5637Address = 0x76
)
const (
PotentiometerAddress = 0x35
)
const RGBLEDAddress = 0x08
const (
SwitchAddress = 0x42
)
const TMP117Address = 0x48
const (
VEML6030Address = 0x10
)
const (
VL53L1XAddress = 0x29
)
Variables ¶
This section is empty.
Functions ¶
func CalculateCCT ¶ added in v1.0.3
CalculateCCT calculates the correlated colour temperature (CCT) from RGB values
func CalculateHSV ¶ added in v1.0.3
CalculateHSV calculates the hue, saturation and value (HSV) from red, green and blue (RGB) values. The red, green and blue values are 0-65535. The hue is 0-360 and the saturation and value are 0-100.
Types ¶
type AHT10 ¶ added in v1.0.4
type AHT10 struct {
// contains filtered or unexported fields
}
func (*AHT10) GetStatus ¶ added in v1.0.4
* * AHT1x status register controls: * 7 6 5 4 3 2 1 0 * BSY, MOD, MOD, xx, CAL, xx, xx, xx * - BSY: * - 1, sensor busy/measuring * - 0, sensor idle/sleeping * - MOD: * - 00, normal mode * - 01, cycle mode * - 1x, comand mode * - CAL: * - 1, calibration on * - 0, calibration off
func (*AHT10) ReadSensor ¶ added in v1.0.4
func (*AHT10) SetInitRegister ¶ added in v1.0.4
type Buzzer ¶ added in v1.0.3
type Buzzer struct {
// contains filtered or unexported fields
}
func (*Buzzer) Close ¶ added in v1.0.3
func (b *Buzzer) Close()
Close cleans up the connection for the Buzzer instances
func (*Buzzer) EnablePowerLED ¶ added in v1.0.3
EnablePowerLED sets the state of the green power LED to on or off depending on the state passed in
func (*Buzzer) GetDeviceID ¶ added in v1.0.3
GetDeviceID gets the device ID of the Buzzer (should be 0x51)
func (*Buzzer) GetFirmwareVersion ¶ added in v1.0.3
GetFirmwareVersion gets the firmware version of the Buzzer (currently 1.1)
func (*Buzzer) GetStatus ¶ added in v1.0.3
GetStatus reads the status of the Buzzer where bit 1 is last command succeeded and bit 2 is last command known
type CAP1203 ¶ added in v1.0.2
type CAP1203 struct {
// contains filtered or unexported fields
}
func NewCAP1203 ¶ added in v1.0.2
NewCAP1203 creates a new CAP1203 touch sensor instance
func (*CAP1203) Close ¶ added in v1.0.2
func (c *CAP1203) Close()
Close cleans up the connection for the CAP1203 touch sensor instance
func (*CAP1203) GetMultipleTouchEnabled ¶ added in v1.0.2
GetMultipleTouchEnabled reads whether multiple touch is enabled
func (*CAP1203) GetSensitivity ¶ added in v1.0.2
GetSensitivity reads the sensitivity level of the touch sensors where 7 is least sensitive and 0 most sensitive
func (*CAP1203) IsTouched ¶ added in v1.0.2
IsTouched indicates that the touch interrupt has been flagged since the last clearing of the interrupt
func (*CAP1203) Read ¶ added in v1.0.2
Read obtains the status of the touch flags and clears the touch interrupt
func (*CAP1203) ReadDeltaCounts ¶ added in v1.0.2
ReadDeltaCounts obtains the raw readings from the touch sensors
func (*CAP1203) SetMultipleTouchEnabled ¶ added in v1.0.2
SetMultipleTouchEnabled sets multiple touch mode
func (*CAP1203) SetSensitivity ¶ added in v1.0.2
SetSensitivity sets the sensitivity level of the touch sensors where 7 is least sensitive and 0 most sensitive
type ENS160 ¶ added in v1.0.4
type ENS160 struct {
// contains filtered or unexported fields
}
func (*ENS160) Close ¶ added in v1.0.4
func (s *ENS160) Close()
Close closes the handle to the device
func (*ENS160) GetHumidity ¶ added in v1.0.4
func (*ENS160) GetOperation ¶ added in v1.0.4
func (*ENS160) GetTemperature ¶ added in v1.0.4
func (*ENS160) ReadTVOC ¶ added in v1.0.4
Read true volatile organic compounds (TrueVOC) including ethanol, toluene, as well as hydrogen and nitrogen dioxide
func (*ENS160) SetHumidity ¶ added in v1.0.4
func (*ENS160) SetTemperature ¶ added in v1.0.4
type I2C ¶
type I2C struct {
// contains filtered or unexported fields
}
func (*I2C) ReadReg16 ¶
ReadReg16 uses the RDWR ioctl call to read from an I2C register with a 16-bit address
func (*I2C) ReadReg16U16BE ¶
ReadReg16U16BE reads an unsigned 16-bit value in big endian format from a register with a 16-bit address
func (*I2C) ReadReg16U16LE ¶
ReadReg16U16LE reads an unsigned 16-bit value in little endian format from a register with a 16-bit address
func (*I2C) ReadReg16U8 ¶
ReadReg16U8 reads an unsigned 8-bit value a register
func (*I2C) ReadRegBit ¶ added in v1.0.2
ReadRegBit reads a single bit from a register
func (*I2C) ReadRegBits ¶ added in v1.0.2
ReadRegBits reads multiple bits from a register
func (*I2C) ReadRegS16BE ¶
ReadRegS16BE reads a signed 16-bit value in big endian format from a register
func (*I2C) ReadRegU16BE ¶
ReadRegU16BE reads an unsigned 16-bit value in big endian format from a register
func (*I2C) ReadRegU16LE ¶
ReadRegU16LE reads an unsigned 16-bit value in little endian format from a register
func (*I2C) ReadRegU24BE ¶
ReadRegU24BE reads an unsigned 24-bit value in big endian format from a register
func (*I2C) ReadRegU32LE ¶ added in v1.0.3
ReadRegU32LE reads an unsigned 32-bit value in little endian format from a register
func (*I2C) WriteReg16 ¶
WriteReg16 uses the RDWR ioctl call to write to an I2C register with a 16-bit address
func (*I2C) WriteReg16U16BE ¶
WriteReg16U16BE writes an unsigned 16-bit big endian value to an I2C register with a 16-bit address
func (*I2C) WriteReg16U16LE ¶
WriteReg16U16LE writes an unsigned 16-bit little endian value to an I2C register with a 16-bit address
func (*I2C) WriteReg16U8 ¶
WriteReg16U8 writes an unsigned 8-bit value to an I2C register with a 16-bit address
func (*I2C) WriteRegBit ¶ added in v1.0.2
WriteRegBit reads the existing registry value and updates the bitPos with val
func (*I2C) WriteRegBits ¶ added in v1.0.2
WriteRegBits reads the existing registry value and updates the numBits at bitPos with val
func (*I2C) WriteRegU16BE ¶
WriteRegU16BE writes an unsigned 16-bit big endian value to an I2C register with a 16-bit address
func (*I2C) WriteRegU16LE ¶
WriteRegU16LE writes an unsigned 16-bit little endian value to an I2C register with a 16-bit address
func (*I2C) WriteRegU8 ¶
WriteRegU8 writes an unsigned 8-bit value to an I2C register
type LM75A ¶ added in v1.0.4
type LM75A struct {
// contains filtered or unexported fields
}
func (*LM75A) ReadTemperature ¶ added in v1.0.4
type MPU6050 ¶
type MPU6050 struct {
// contains filtered or unexported fields
}
func (*MPU6050) GetAccelRangeRaw ¶
func (t *MPU6050) GetAccelRangeRaw() (r MPU6050AccelRange, err error)
func (*MPU6050) GetAccelRangeValue ¶
func (*MPU6050) GetGyroRangeRaw ¶
func (t *MPU6050) GetGyroRangeRaw() (r MPU6050GyroRange, err error)
func (*MPU6050) GetGyroRangeValue ¶
func (*MPU6050) ReadAccelData ¶
func (*MPU6050) ReadGyroData ¶
func (*MPU6050) ReadTemperature ¶
func (*MPU6050) SetAccelRange ¶
func (t *MPU6050) SetAccelRange(r MPU6050AccelRange) (err error)
func (*MPU6050) SetGyroRange ¶
func (t *MPU6050) SetGyroRange(r MPU6050GyroRange) (err error)
type MPU6050AccelRange ¶
type MPU6050AccelRange uint16
const ( MPU6050AccelRange2G MPU6050AccelRange = 0x00 MPU6050AccelRange4G MPU6050AccelRange = 0x08 MPU6050AccelRange8G MPU6050AccelRange = 0x10 MPU6050AccelRange16G MPU6050AccelRange = 0x18 )
type MPU6050GyroRange ¶
type MPU6050GyroRange uint16
const ( MPU6050GyroRange250Deg MPU6050GyroRange = 0x00 MPU6050GyroRange500Deg MPU6050GyroRange = 0x08 MPU6050GyroRange1000Deg MPU6050GyroRange = 0x10 MPU6050GyroRange2000Deg MPU6050GyroRange = 0x18 )
type MS5637 ¶
type MS5637 struct {
// contains filtered or unexported fields
}
func (*MS5637) ReadEEPROMCoeffs ¶
func (*MS5637) SetResolution ¶
type MS5637ADCParams ¶
type MS5637ADCParams struct {
// contains filtered or unexported fields
}
type Potentiometer ¶ added in v1.0.4
type Potentiometer struct {
// contains filtered or unexported fields
}
func NewPotentiometer ¶ added in v1.0.4
func NewPotentiometer(addr uint8, bus int) (s *Potentiometer, err error)
func (*Potentiometer) Close ¶ added in v1.0.4
func (s *Potentiometer) Close()
Close closes the handle to the device
func (*Potentiometer) GetLED ¶ added in v1.0.4
func (s *Potentiometer) GetLED() (v uint8, err error)
func (*Potentiometer) GetType ¶ added in v1.0.4
func (s *Potentiometer) GetType() int
func (*Potentiometer) ReadFirmwareVersion ¶ added in v1.0.4
func (s *Potentiometer) ReadFirmwareVersion() (major uint8, minor uint8, err error)
Returns the firmware version
func (*Potentiometer) ReadRawValue ¶ added in v1.0.4
func (s *Potentiometer) ReadRawValue() (v uint16, err error)
Returns a value from 0 to 1023 as the raw value from the potentiometer
func (*Potentiometer) ReadValue ¶ added in v1.0.4
func (s *Potentiometer) ReadValue() (v float64, err error)
Returns a value from s.minimum to s.maximum from the potentiometer
func (*Potentiometer) SelfTest ¶ added in v1.0.4
func (s *Potentiometer) SelfTest() (v uint8, err error)
func (*Potentiometer) SetLED ¶ added in v1.0.4
func (s *Potentiometer) SetLED(enable bool) (err error)
func (*Potentiometer) SetMaximum ¶ added in v1.0.4
func (s *Potentiometer) SetMaximum(maximum float64)
func (*Potentiometer) SetMinimum ¶ added in v1.0.4
func (s *Potentiometer) SetMinimum(minimum float64)
type QwiicPIR ¶ added in v1.0.3
type QwiicPIR struct {
// contains filtered or unexported fields
}
func NewQwiicPIR ¶ added in v1.0.3
NewQwiicPIR creates a new QwiicPIR instances
func (*QwiicPIR) ClearEventBits ¶ added in v1.0.3
ClearEventBits clears the raw object detected, object removed and event available bits
func (*QwiicPIR) Close ¶ added in v1.0.3
func (p *QwiicPIR) Close()
Close cleans up the connection for the QwiicPIR instances
func (*QwiicPIR) GetDebounceEvents ¶ added in v1.0.3
GetDebounceEvents gets the availability of the event, if it is detected or removed and clears the bits after reading
func (*QwiicPIR) GetDebounceTime ¶ added in v1.0.3
GetDebounceTime returns the debounce time in milliseconds
func (*QwiicPIR) GetDeviceID ¶ added in v1.0.3
GetDeviceID gets the device ID of the QwiicPIR (should be 0x72)
func (*QwiicPIR) GetFirmwareVersion ¶ added in v1.0.3
GetFirmwareVersion gets the firmware version of the QwiicPIR (currently 1.1)
func (*QwiicPIR) GetRawReading ¶ added in v1.0.3
GetRawReading detected flag returns true if the PIR has detected an object, otherwise false
func (*QwiicPIR) IsAvailable ¶ added in v1.0.3
IsAvailable available flag returns true if the PIR has either a detected or a removal event
func (*QwiicPIR) IsDetectedQueueEmpty ¶ added in v1.0.3
IsDetectedQueueEmpty checks in the detect queue is empty
func (*QwiicPIR) IsDetectedQueueFull ¶ added in v1.0.3
IsDetectedQueueFull checks in the detect queue is full
func (*QwiicPIR) IsObjectDetected ¶ added in v1.0.3
IsObjectDetected detected flag returns true if the PIR has detected an object after debouncing, otherwise false
func (*QwiicPIR) IsRemovedQueueEmpty ¶ added in v1.0.3
IsRemovedQueueEmpty checks in the detect queue is empty
func (*QwiicPIR) IsRemovedQueueFull ¶ added in v1.0.3
IsRemovedQueueFull checks in the detect queue is full
func (*QwiicPIR) IstObjectRemoved ¶ added in v1.0.3
IstObjectRemoved removed flag returns true if the PIR has detected the removal of an object after debouncing, otherwise false
func (*QwiicPIR) PopDetectedQueue ¶ added in v1.0.3
PopDetectedQueue returns the oldest value in the detected queue in milliseconds and then removes it
func (*QwiicPIR) PopRemoveQueue ¶ added in v1.0.3
PopRemoveQueue returns the oldest value in the remove queue in milliseconds and then removes it
func (*QwiicPIR) SetDebounceTime ¶ added in v1.0.3
SetDebounceTime the time in milliseconds to set the debounce time in
func (*QwiicPIR) TimeSinceFirstDetect ¶ added in v1.0.3
TimeSinceFirstDetect number of milliseconds since the first detect event
func (*QwiicPIR) TimeSinceFirstRemove ¶ added in v1.0.3
TimeSinceFirstRemove number of milliseconds since the first remove event
func (*QwiicPIR) TimeSinceLasRemove ¶ added in v1.0.3
TimeSinceLasRemove number of milliseconds since the last remove event
func (*QwiicPIR) TimeSinceLastDetect ¶ added in v1.0.3
TimeSinceLastDetect number of milliseconds since the last detect event
type RGBLED ¶ added in v1.0.3
type RGBLED struct {
// contains filtered or unexported fields
}
func (*RGBLED) ClearPixels ¶ added in v1.0.3
func (l *RGBLED) ClearPixels()
ClearPixels sets all the pixel values to off. Note that Show() needs to be called to update the LEDs.
func (*RGBLED) Close ¶ added in v1.0.3
func (l *RGBLED) Close()
Close cleans up the connection for the RGB LED instances
func (*RGBLED) EnablePowerLED ¶ added in v1.0.3
EnablePowerLED sets the state of the green power LED to on or off depending on the state passed in
func (*RGBLED) FillPixels ¶ added in v1.0.3
FillPixels sets all the pixel colors to red, green and blue levels which are each from 0 being least bright to 255 being most bright for that color. Note that Show() needs to be called to update the LEDs.
func (*RGBLED) GetDeviceID ¶ added in v1.0.3
GetDeviceID gets the device ID of the RGB LED device: REVISIT - currently failing
func (*RGBLED) GetFirmwareVersion ¶ added in v1.0.3
GetFirmwareVersion gets the firmware version of the RGB LED device: REVISIT - currently failing
func (*RGBLED) SetBrightness ¶ added in v1.0.3
SetBrightness sets the brightness of all LEDs to a level from 0 being least bright to 255 being most bright
type Switch ¶ added in v1.0.4
type Switch struct {
// contains filtered or unexported fields
}
func (*Switch) Close ¶ added in v1.0.4
func (s *Switch) Close()
Close closes the handle to the device
func (*Switch) GetDebounceEMAParameters ¶ added in v1.0.4
Get the exponential moving average (EMA) parameters for the switch debounce (default parameter is 63 and period is 20)
func (*Switch) GetDoublePressDuration ¶ added in v1.0.4
If the button is pressed twice within this period (ms) a double-press will be registered (default duration is 300)
func (*Switch) GetPressCount ¶ added in v1.0.4
func (*Switch) ReadFirmwareVersion ¶ added in v1.0.4
Returns the firmware version
func (*Switch) SetDebounceEMAParameters ¶ added in v1.0.4
Set the exponential moving average (EMA) parameters for the switch debounce
func (*Switch) SetDoublePressDuration ¶ added in v1.0.4
If the button is pressed twice within this period (ms) a double-press will be registered
func (*Switch) WasDoublePressed ¶ added in v1.0.4
Was pressed twice within the double-press duration
func (*Switch) WasPressed ¶ added in v1.0.4
type VEML6030 ¶
type VEML6030 struct {
// contains filtered or unexported fields
}
func (*VEML6030) DisablePowerSave ¶ added in v1.0.1
func (*VEML6030) EnablePowerSave ¶ added in v1.0.1
func (*VEML6030) GetGainRaw ¶ added in v1.0.1
func (l *VEML6030) GetGainRaw() (gain VEML6030Gain, err error)
GetGainRaw reads the raw gain setting from: Configuration register bits 12:11
func (*VEML6030) GetGainValue ¶ added in v1.0.1
GetGain reads the sensor gain
func (*VEML6030) GetIntegrationTimeRaw ¶ added in v1.0.1
func (l *VEML6030) GetIntegrationTimeRaw() (integTime VEML6030IntegrationTime, err error)
GetIntegrationTimeRaw reads the raw integration time setting from: Configuration register bits 9:6
func (*VEML6030) GetIntegrationTimeValue ¶ added in v1.0.1
GetIntegrationTime reads the integration time in ms
func (*VEML6030) GetPowerSave ¶ added in v1.0.1
GetPowerSave reads the current power save state
func (*VEML6030) SetGain ¶ added in v1.0.1
func (l *VEML6030) SetGain(gain VEML6030Gain) (err error)
SetGain sets the gain
func (*VEML6030) SetIntegrationTime ¶ added in v1.0.1
func (l *VEML6030) SetIntegrationTime(integTime VEML6030IntegrationTime) (err error)
SetIntegrationTime sets the integration time
type VEML6030Gain ¶ added in v1.0.1
type VEML6030Gain uint16
const ( VEML6030GainOneEighth VEML6030Gain = 2 VEML6030GainOneQuarter VEML6030Gain = 3 VEML6030GainOne VEML6030Gain = 0 VEML6030GainTwo VEML6030Gain = 1 )
type VEML6030IntegrationTime ¶ added in v1.0.1
type VEML6030IntegrationTime uint16
const ( VEML6030IntegrationTime25 VEML6030IntegrationTime = 12 VEML6030IntegrationTime50 VEML6030IntegrationTime = 8 VEML6030IntegrationTime100 VEML6030IntegrationTime = 0 VEML6030IntegrationTime200 VEML6030IntegrationTime = 1 VEML6030IntegrationTime400 VEML6030IntegrationTime = 2 VEML6030IntegrationTime800 VEML6030IntegrationTime = 3 )
type VEML6040 ¶ added in v1.0.3
type VEML6040 struct {
// contains filtered or unexported fields
}
func NewVEML6040 ¶ added in v1.0.3
NewVEML6040 creates a new VEML6040 instances
type VL53L1X ¶
type VL53L1X struct {
// contains filtered or unexported fields
}