mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-07-26 10:38:41 +00:00
bee7422c3a
Fix HTS221, LPS22HB and APDS9960 drivers and their examples for Arduino Nano 33 BLE: * Update hts221_nano_33_ble.go * Update lps22hb_nano_33_ble.go * Update apds9960_nano_33_ble.go
25 lines
573 B
Go
25 lines
573 B
Go
//go:build nano_33_ble
|
|
// +build nano_33_ble
|
|
|
|
package apds9960
|
|
|
|
import (
|
|
"machine"
|
|
"time"
|
|
)
|
|
|
|
// Configure sets up the APDS-9960 device.
|
|
func (d *Device) Configure(cfg Configuration) {
|
|
|
|
// Following lines are Nano 33 BLE specific, they have nothing to do with sensor per se
|
|
machine.LSM_PWR.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
|
machine.LSM_PWR.High()
|
|
machine.I2C_PULLUP.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
|
machine.I2C_PULLUP.High()
|
|
// Wait a moment
|
|
time.Sleep(10 * time.Millisecond)
|
|
|
|
// configure device
|
|
d.configureDevice(cfg)
|
|
}
|