Skip to content

Commit 8f4f12d

Browse files
Ported LCD createChar() method from Arduino lib
1 parent dbe2adc commit 8f4f12d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Adafruit_CharLCDPlate/Adafruit_CharLCDPlate.py

+6
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ def noAutoscroll(self):
211211
self.displaymode &= ~self.LCD_ENTRYSHIFTINCREMENT
212212
self.write4bits(self.LCD_ENTRYMODESET | self.displaymode)
213213

214+
def createChar(self, location, bitmap):
215+
self.write4bits(self.LCD_SETCGRAMADDR | ((location & 7) << 3))
216+
for i in range(8):
217+
self.write4bits(bitmap[i], True)
218+
self.write4bits(self.LCD_SETDDRAMADDR)
219+
214220
def write4bits(self, bits, char_mode=False):
215221
""" Send command to LCD """
216222
#self.delayMicroseconds(1000) # 1000 microsecond sleep

0 commit comments

Comments
 (0)