Skip to content

Commit fdf4fdf

Browse files
committed
Use round instead of int
1 parent 9b1a4bd commit fdf4fdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/circuitplayground_light_neopixels.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
def scale_range(value):
1616
"""Scale a value from 0-320 (light range) to 0-9 (NeoPixel range).
1717
Allows remapping light value to pixel position."""
18-
return int(value / 320 * 9)
18+
return round(value / 320 * 9)
1919

2020

2121
while True:

0 commit comments

Comments
 (0)