File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 22
22
23
23
def normalized_rms (values ):
24
24
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 ) ))
27
27
28
28
apds9960 .enable_proximity = True
29
29
apds9960 .enable_color = True
@@ -44,5 +44,5 @@ def normalized_rms(values):
44
44
print ("Acceleration: {:.2f} {:.2f} {:.2f} m/s^2" .format (* lsm6ds33 .acceleration ))
45
45
print ("Gyro: {:.2f} {:.2f} {:.2f} dps" .format (* lsm6ds33 .gyro ))
46
46
print ("Humidity: {:.1f} %" .format (sht31d .relative_humidity ))
47
- print ("Sound level:" , int ( normalized_rms (samples ) ))
47
+ print ("Sound level:" , normalized_rms (samples ))
48
48
time .sleep (0.3 )
You can’t perform that action at this time.
0 commit comments