Browse Source

fix float errors in _lcd_update()

main 0.2
Franzi 1 year ago
parent
commit
1058892564
Signed by: kunsi GPG Key ID: 12E3D2136B818350
  1. 6
      octoprint_hd44780/__init__.py

6
octoprint_hd44780/__init__.py

@ -113,6 +113,8 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
if self._lcd_updating:
return
bytes_per_send_cycle = int(self.cols*(self.rows/2))
self._lcd_updating = True
line1 = self._line1.ljust(self.cols, ' ')
@ -122,12 +124,12 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin,
message = line1 + line3
self._lcd_send_byte(self._lcd_line1, self._lcd_cmd)
for i in range(self.cols*self.rows/2):
for i in range(bytes_per_send_cycle):
self._lcd_send_byte(ord(message[i]), self._lcd_chr)
message = line2 + line4
self._lcd_send_byte(self._lcd_line2, self._lcd_cmd)
for i in range(self.cols*self.rows/2):
for i in range(bytes_per_send_cycle):
self._lcd_send_byte(ord(message[i]), self._lcd_chr)
self._lcd_updating = False

Loading…
Cancel
Save