Skip to content

Commit 8cf35e8

Browse files
committed
Adds write to getDistance
1 parent 82ea547 commit 8cf35e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/sfeQwiicUltrasonic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ sfeTkError_t sfeQwiicUltrasonic::getDistace(uint16_t &distance)
3535
uint8_t rawData[2] = {0, 0};
3636

3737
// Attempt to read the distance
38+
sfeTkError_t err = _theBus->write(kQwiicUltrasonicRegisterTrigger, rawData, 2, bytesRead);
3839
sfeTkError_t err = _theBus->readRegisterRegion(kQwiicUltrasonicRegisterTrigger, rawData, 2, bytesRead);
3940

4041
// Check whether the read was successful

0 commit comments

Comments
 (0)