Skip to content

Commit fdccb3b

Browse files
committed
BeagleBone Black fix ups.
1 parent ef2c32d commit fdccb3b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Adafruit_CharLCD/Adafruit_CharLCD.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88

99
from time import sleep
10-
10+
import Adafruit_BBIO.GPIO as GPIO
1111

1212
class Adafruit_CharLCD(object):
1313

@@ -53,18 +53,12 @@ class Adafruit_CharLCD(object):
5353
LCD_5x10DOTS = 0x04
5454
LCD_5x8DOTS = 0x00
5555

56-
def __init__(self, pin_rs=25, pin_e=24, pins_db=[23, 17, 21, 22], GPIO=None):
57-
# Emulate the old behavior of using RPi.GPIO if we haven't been given
58-
# an explicit GPIO interface to use
59-
if not GPIO:
60-
import RPi.GPIO as GPIO
61-
GPIO.setwarnings(False)
56+
def __init__(self, pin_rs="P8_31", pin_e="P8_32", pins_db=["P8_27","P8_28","P8_29","P8_30"]):
6257
self.GPIO = GPIO
6358
self.pin_rs = pin_rs
6459
self.pin_e = pin_e
6560
self.pins_db = pins_db
6661

67-
self.GPIO.setmode(GPIO.BCM)
6862
self.GPIO.setup(self.pin_e, GPIO.OUT)
6963
self.GPIO.setup(self.pin_rs, GPIO.OUT)
7064

@@ -137,7 +131,7 @@ def blink(self):
137131
self.displaycontrol |= self.LCD_BLINKON
138132
self.write4bits(self.LCD_DISPLAYCONTROL | self.displaycontrol)
139133

140-
def DisplayLeft(self):
134+
def scrollDisplayLeft(self):
141135
""" These commands scroll the display without changing the RAM """
142136
self.write4bits(self.LCD_CURSORSHIFT | self.LCD_DISPLAYMOVE | self.LCD_MOVELEFT)
143137

@@ -206,5 +200,6 @@ def message(self, text):
206200

207201
if __name__ == '__main__':
208202
lcd = Adafruit_CharLCD()
203+
lcd.begin(16,2)
209204
lcd.clear()
210205
lcd.message(" Adafruit 16x2\n Standard LCD")

0 commit comments

Comments
 (0)