mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-21 06:59:00 +00:00
Fix Nano 33 BLE drivers (#351)
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
This commit is contained in:
+8
-8
@@ -21,6 +21,14 @@ type Device struct {
|
||||
temperatureZero float32
|
||||
}
|
||||
|
||||
// New creates a new HTS221 connection. The I2C bus must already be
|
||||
// configured.
|
||||
//
|
||||
// This function only creates the Device object, it does not touch the device.
|
||||
func New(bus drivers.I2C) Device {
|
||||
return Device{bus: bus, Address: HTS221_ADDRESS}
|
||||
}
|
||||
|
||||
// Connected returns whether HTS221 has been found.
|
||||
// It does a "who am I" request and checks the response.
|
||||
func (d *Device) Connected() bool {
|
||||
@@ -29,14 +37,6 @@ func (d *Device) Connected() bool {
|
||||
return data[0] == 0xBC
|
||||
}
|
||||
|
||||
// Configure sets up the HTS221 device for communication.
|
||||
func (d *Device) Configure() {
|
||||
// read calibration data
|
||||
d.calibration()
|
||||
// activate device and use block data update mode
|
||||
d.Power(true)
|
||||
}
|
||||
|
||||
// Power is for turn on/off the HTS221 device
|
||||
func (d *Device) Power(status bool) {
|
||||
data := []byte{0}
|
||||
|
||||
Reference in New Issue
Block a user