Skip to content

Commit 90d483f

Browse files
committed
Intify more cleanly.
1 parent 019914d commit 90d483f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Adafruit_Feather_Sense/feather_sense_sensor_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
def normalized_rms(values):
2424
minbuf = int(sum(values) / len(values))
25-
return math.sqrt(sum(float(sample - minbuf) *
26-
(sample - minbuf) for sample in values) / len(values))
25+
return int(math.sqrt(sum(float(sample - minbuf) *
26+
(sample - minbuf) for sample in values) / len(values)))
2727

2828
apds9960.enable_proximity = True
2929
apds9960.enable_color = True
@@ -44,5 +44,5 @@ def normalized_rms(values):
4444
print("Acceleration: {:.2f} {:.2f} {:.2f} m/s^2".format(*lsm6ds33.acceleration))
4545
print("Gyro: {:.2f} {:.2f} {:.2f} dps".format(*lsm6ds33.gyro))
4646
print("Humidity: {:.1f} %".format(sht31d.relative_humidity))
47-
print("Sound level:", int(normalized_rms(samples)))
47+
print("Sound level:", normalized_rms(samples))
4848
time.sleep(0.3)

0 commit comments

Comments
 (0)