Skip to content

Commit fe2c0aa

Browse files
committed
Minor fix to function calls now used in the toolkit
1 parent 35223a5 commit fe2c0aa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/Example1_BasicReadings/Example1_BasicReadings.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "SparkFun_Qwiic_Ultrasonic_Arduino_Library.h"
1616

1717
// Create an ultrasonic sensor object
18-
QwiicUltrasonic myUltrasonic(kQwiicUltrasonicFWLatest);
18+
QwiicUltrasonic myUltrasonic;
1919

2020
// Here we set the device address. Note that an older version of the Qwiic
2121
// Ultrasonic firmware used a default address of 0x00. If yours uses 0x00,

library.properties

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ paragraph=
77
category=Sensors
88
url=https://github.com/sparkfun/SparkFun_Qwiic_Ultrasonic_Arduino_Library
99
architectures=*
10+
depends=SparkFun Toolkit

src/sfeQwiicUltrasonic.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ sfeTkError_t sfeQwiicUltrasonic::getDistance(uint16_t &distance)
5151
uint8_t rawData[2] = {};
5252

5353
// Get the distance
54-
//sfeTkError_t err = _theBus->readBlock(kUltrasonicDistanceReadCommand, rawData, numBytes, bytesRead);
5554
sfeTkError_t err = _theBus->readRegisterRegion(kUltrasonicDistanceReadCommand, rawData, numBytes, bytesRead);
5655

5756
// Check whether the read was successful
@@ -92,7 +91,7 @@ sfeTkError_t sfeQwiicUltrasonic::changeAddress(uint8_t &address)
9291
const uint8_t toWrite[2] = {kUltrasonicAddressChangeCommand, address};
9392

9493
//Write the new address to the device
95-
err = _theBus->writeBlock(toWrite, numBytes);
94+
err = _theBus->writeRegion(toWrite, numBytes);
9695
}
9796
else {
9897
//There was some error setting the version in the constructor

0 commit comments

Comments
 (0)