Skip to content

Commit 49d74c4

Browse files
committed
Removes the division by 10 in the getDistance function so that it returns mm by default
* Updates example one with a few commented out lines of code that print out measurements in different units * Rolls version
1 parent a7ebb41 commit 49d74c4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

examples/Example01_PresenceBasicReadings/Example01_PresenceBasicReadings.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ void loop()
8888
Serial.print("Presence Detected: ");
8989
Serial.print(distance);
9090
Serial.println("mm");
91+
//Serial.print(distance * .01);
92+
//Serial.println("cm");
93+
//Serial.print(distance * .001);
94+
//Serial.println("m");
95+
//Serial.print(distance * .001);
96+
//Serial.println("m");
97+
//Serial.print(distance * .03937008);
98+
//Serial.println("In");
9199
}
92100
else
93101
{

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun XM125 Arduino Library
2-
version=1.0.1
2+
version=1.0.2
33
author=SparkFun Electronics <techsupport@sparkfun.com>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=An Arduino library to make use of the Qwiic XM125 A121 Pulsed Radar Module from Acconeer.
@@ -8,4 +8,4 @@ category=Sensors
88
url=https://github.com/sparkfun/SparkFun_Qwiic_XM125_Arduino_Library
99
architectures=*
1010
depends=SparkFun Toolkit
11-
includes=SparkFun_Qwiic_XM125_Arduino_Library.h, sfeQwiicXM125.h, sfeXM125Regs.h
11+
includes=SparkFun_Qwiic_XM125_Arduino_Library.h, sfeQwiicXM125.h, sfeXM125Regs.h

src/sfeQwiicXM125.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,6 @@ int32_t QwDevXM125::getPresenceDistance(uint32_t &distance)
10931093
size_t readBytes = 0;
10941094
int32_t retVal = _theBus->readRegister16Region(SFE_XM125_PRESENCE_DISTANCE, (uint8_t*)&distance, 4, readBytes);
10951095
distance = __builtin_bswap32(distance);
1096-
distance = distance/10;
10971096
return retVal;
10981097
}
10991098

@@ -1474,4 +1473,4 @@ int32_t QwDevXM125::presenceBusyWait()
14741473
return retVal;
14751474
}
14761475
return 0; // 0 on success
1477-
}
1476+
}

0 commit comments

Comments
 (0)