|
38 | 38 | import displayio |
39 | 39 | import framebufferio |
40 | 40 | import picodvi |
41 | | -import simpleio |
42 | 41 | import storage |
43 | 42 | import supervisor |
| 43 | +from adafruit_simplemath import map_range |
44 | 44 | from digitalio import DigitalInOut, Direction, Pull |
45 | 45 | from neopixel import NeoPixel |
46 | 46 |
|
@@ -278,11 +278,11 @@ def volume(self, volume_level: int) -> None: |
278 | 278 |
|
279 | 279 | if volume_level > self.safe_volume_limit: |
280 | 280 | raise ValueError( |
281 | | - f"Volume level must be less than or equal to " |
282 | | - + f"safe_volume_limit: {self.safe_volume_limit}. " |
283 | | - + f"Using higher values could damage speakers. " |
284 | | - + f"To override this limitation pass a value larger {self.safe_volume_limit} " |
285 | | - + f"for the safe_volume_limit argument of the constructor." |
| 281 | + f"""Volume level must be less than or equal to |
| 282 | +safe_volume_limit: {self.safe_volume_limit}. |
| 283 | +Using higher values could damage speakers. |
| 284 | +To override this limitation pass a value larger {self.safe_volume_limit} |
| 285 | +for the safe_volume_limit argument of the constructor.""" |
286 | 286 | ) |
287 | 287 |
|
288 | 288 | self._volume = volume_level |
@@ -316,5 +316,5 @@ def _apply_volume(self) -> None: |
316 | 316 | """ |
317 | 317 | Map the basic volume level to a db value and set it on the DAC. |
318 | 318 | """ |
319 | | - db_val = simpleio.map_range(self._volume, 1, 20, -63, 23) |
| 319 | + db_val = map_range(self._volume, 1, 20, -63, 23) |
320 | 320 | self._dac.dac_volume = db_val |
0 commit comments