Skip to content

Commit 0aea7b8

Browse files
author
=Dale Weber
committed
Switched from using int() to using round() in the brightness routine.
1 parent 92d73ac commit 0aea7b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_ht16k33/ht16k33.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def brightness(self, brightness):
9090
raise ValueError('Brightness must be a decimal number in the range: 0.0-1.0')
9191

9292
self._brightness = brightness
93-
xbright = int(15 * brightness)
93+
xbright = round(15 * brightness)
9494
xbright = xbright & 0x0F
9595
self._write_cmd(_HT16K33_CMD_BRIGHTNESS | xbright)
9696

0 commit comments

Comments
 (0)