From 769275e3d365e083c2deea4f768e136e14e8b4f5 Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Tue, 3 Mar 2020 05:28:14 +0100 Subject: [PATCH] Fix #9 --- README.rst | 3 --- adafruit_thermal_printer/thermal_printer.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index c7a8f8d..9c6ddee 100644 --- a/README.rst +++ b/README.rst @@ -26,9 +26,6 @@ Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading `the Adafruit library and driver bundle `_. -**NOTE:** This library is not supported for smaller non-Express boards like -the Trinket M0, Gemma M0, etc. - Installing from PyPI ==================== diff --git a/adafruit_thermal_printer/thermal_printer.py b/adafruit_thermal_printer/thermal_printer.py index 88a2d25..c63f5ef 100644 --- a/adafruit_thermal_printer/thermal_printer.py +++ b/adafruit_thermal_printer/thermal_printer.py @@ -202,7 +202,7 @@ def _write_char(self, char): if char == '\r': return # Strip carriage returns by skipping them. self._wait_timeout() - self._uart.write(char.encode('ascii')) + self._uart.write(bytes(char, 'ascii')) delay = self._byte_delay_s # Add extra delay for newlines or moving past the last column. if char == '\n' or self._column == self._max_column: @@ -238,7 +238,7 @@ def _unset_print_mode(self, mask): def send_command(self, command): """Send a command string to the printer.""" - self._uart.write(command.encode('ascii')) + self._uart.write(bytes(command, 'ascii')) # Do initialization in warm_up instead of the initializer because this # initialization takes a long time (5 seconds) and shouldn't happen during