Commits

Anonymous committed 334c70a Draft

small fix, second param call should be int

Comments (0)

Files changed (1)

src/platform/stm32f4/lcd.py

         sys.wait(50)
 
         # Now we pull both RS and R/W low to begin commands
-        gpio.digital_write(self.rs_pin[0], self.rs_pin[1], gpio.LOW)
-        gpio.digital_write(self.enable_pin[0], self.enable_pin[1], gpio.LOW)
+        gpio.digital_write(self.rs_pin[0], int(self.rs_pin[1]), gpio.LOW)
+        gpio.digital_write(self.enable_pin[0], int(self.enable_pin[1]), gpio.LOW)
 
         if _rw_pin != 255 : 
-              gpio.digital_write(self.rw_pin[0], self.rw_pin[1], gpio.LOW)
+              gpio.digital_write(self.rw_pin[0], int(self.rw_pin[1]), gpio.LOW)
 
         # //put the LCD into 4 bit or 8 bit mode
         if not (self._displayfunction and LCD_8BITMODE) :
     def send(self, value, mode) :
         """
         """
-        gpio.digital_write(self.rs_pin[0], self.rs_pin[1], mode)
+        gpio.digital_write(self.rs_pin[0], int(self.rs_pin[1]), mode)
     
         # if there is a RW pin indicated, set it low to Write
         if (self.rw_pin != 255) :
-           gpio.digital_write(self.rw_pin[0], self.rw_pin[1], gpio.LOW)
+           gpio.digital_write(self.rw_pin[0], int(self.rw_pin[1]), gpio.LOW)
       
         if (self._displayfunction and LCD_8BITMODE):
            self.write8bits(value)
     def pulseEnable(self) :
         """
         """
-        gpio.digital_write(self.enable_pin[0], self.enable_pin[1], gpio.LOW)
+        gpio.digital_write(self.enable_pin[0], int(self.enable_pin[1]), gpio.LOW)
         sys.wait(1)
-        gpio.digital_write(self.enable_pin[0], self.enable_pin[1], gpio.HIGH)
+        gpio.digital_write(self.enable_pin[0], int(self.enable_pin[1]), gpio.HIGH)
         # enable pulse must be >450ns
         sys.wait(1)
-        gpio.digital_write(self.enable_pin[0], self.enable_pin[1], gpio.LOW)
+        gpio.digital_write(self.enable_pin[0], int(self.enable_pin[1]), gpio.LOW)
         # commands need > 37us to settle
         sys.wait(1)
     
         """
         """
         for i in range(4) :
-            gpio.pin_mode(self.data_pins[i][0], self.data_pins[i][1], gpio.OUTPUT)
-            gpio.digital_write(self.data_pins[i][0], self.data_pins[i][1], (value >> i) & 0x01)
+            gpio.pin_mode(self.data_pins[i][0], int(self.data_pins[i][1]), gpio.OUTPUT)
+            gpio.digital_write(self.data_pins[i][0], int(self.data_pins[i][1]), (value >> i) & 0x01)
         self.pulseEnable()
     
     def write4bits(self, value) :
         """
         """
         for i in range(8) :
-            gpio.pin_mode(self.data_pins[i][0], self.data_pins[i][1], gpio.OUTPUT)
-            gpio.digital_write(self.data_pins[i][0], self.data_pins[i][1], (value >> i) & 0x01)
+            gpio.pin_mode(self.data_pins[i][0], int(self.data_pins[i][1]), gpio.OUTPUT)
+            gpio.digital_write(self.data_pins[i][0], int(self.data_pins[i][1]), (value >> i) & 0x01)
         self.pulseEnable()