From ee7d172e6e8009695a68bb04c9da72e70514078e Mon Sep 17 00:00:00 2001 From: Theuno Date: Wed, 27 Aug 2014 18:24:02 +0000 Subject: [PATCH] Add _Contrast variable to BitWizardLcd, to be able to use the variable (as with _Backlight) Minor improvement --- src/BitWizard/bw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BitWizard/bw.py b/src/BitWizard/bw.py index 397c7ac..fa9b27d 100644 --- a/src/BitWizard/bw.py +++ b/src/BitWizard/bw.py @@ -619,6 +619,7 @@ class BitWizardLcd(BitWizardBase): DefaultAddress = 0x82 Cursor = "Off" #Blink, On _Backlight = 128 + _Contrast = 128 def SetCursor(self,x,y): """ @@ -651,7 +652,8 @@ def Contrast(self, value=128): """ @brief Change LCD contrast, defaults to 128 """ - self.Bus.Write_uInt8(self.Address,Contrast,value) + if value > 0 : self._Contrast = value + self.Bus.Write_uInt8(self.Address,Contrast,self._Contrast) # Set the BackLight of the LCD def Backlight(self, value = 128):