|
|
|
@ -1,7 +1,5 @@ |
|
|
|
|
# coding=utf-8 |
|
|
|
|
|
|
|
|
|
from __future__ import absolute_import |
|
|
|
|
|
|
|
|
|
__author__ = "Franziska Kunsmann <hi@kunsmann.eu>" |
|
|
|
|
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" |
|
|
|
|
__copyright__ = "Copyright (C) 2017 Franziska Kunsmann - Released under terms of the AGPLv3 License" |
|
|
|
@ -20,6 +18,7 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, |
|
|
|
|
self._pin_to_gpio_rev3 = [-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, 5, -1, 6, 12, 13, -1, 19, 16, 26, 20, -1, 21 ] |
|
|
|
|
self._configuredGPIOPins = [] |
|
|
|
|
|
|
|
|
|
# FIXME hardcoded GPIO pins |
|
|
|
|
self.pin_rs = 15 |
|
|
|
|
self.pin_e = 16 |
|
|
|
|
self.pin_d4 = 21 |
|
|
|
@ -95,6 +94,7 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, |
|
|
|
|
|
|
|
|
|
self._configuredGPIOPins = [self._gpio_get_pin(self.pin_rs), self._gpio_get_pin(self.pin_e), self._gpio_get_pin(self.pin_d4), self._gpio_get_pin(self.pin_d5), self._gpio_get_pin(self.pin_d6), self._gpio_get_pin(self.pin_d7)] |
|
|
|
|
|
|
|
|
|
# FIXME hardcoded LCD size |
|
|
|
|
self._lcd_send_byte(0x33, self._lcd_cmd) |
|
|
|
|
self._lcd_send_byte(0x32, self._lcd_cmd) |
|
|
|
|
self._lcd_send_byte(0x28, self._lcd_cmd) |
|
|
|
@ -146,11 +146,11 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d6), GPIO.HIGH) |
|
|
|
|
if bits & 0x80 == 0x80: |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d7), GPIO.HIGH) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.HIGH) |
|
|
|
|
time.sleep(self._lcd_pulse) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.LOW) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d4), GPIO.LOW) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d5), GPIO.LOW) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d6), GPIO.LOW) |
|
|
|
@ -163,11 +163,11 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d6), GPIO.HIGH) |
|
|
|
|
if bits&0x08==0x08: |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_d7), GPIO.HIGH) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.HIGH) |
|
|
|
|
time.sleep(self._lcd_pulse) |
|
|
|
|
GPIO.output(self._gpio_get_pin(self.pin_e), GPIO.LOW) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
time.sleep(self._lcd_delay) |
|
|
|
|
|
|
|
|
|
def on_printer_add_temperature(self, data): |
|
|
|
|
if not self._ClosedOrError: |
|
|
|
@ -209,7 +209,8 @@ class LCD_HD44780(octoprint.plugin.StartupPlugin, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__plugin_name__ = "LCD: HD44780-compatible" |
|
|
|
|
|
|
|
|
|
__plugin_author__ = "Kunsi" |
|
|
|
|
__plugin_pythoncompat__ = ">=3,<4" |
|
|
|
|
def __plugin_load__(): |
|
|
|
|
global __plugin_implementation__ |
|
|
|
|
__plugin_implementation__ = LCD_HD44780() |
|
|
|
|