Created
August 26, 2015 06:48
-
-
Save windows98SE/baa2b7545a1ea4250a3a to your computer and use it in GitHub Desktop.
Adafruit LCD scroll only line 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import time | |
| import Adafruit_CharLCD as LCD | |
| lcd_columns = 16 | |
| lcd = LCD.Adafruit_CharLCDPlate() | |
| lcd.set_backlight(0) | |
| lcd.set_color(0.0, 0.0, 0.0) | |
| title = '[stephack]' | |
| msg = 'Adafruit make an adapter that uses an MCP23017 chip to allow an LCD character display (compatible with the Hitachi HD44780) to be driven over the I2C bus from the Raspberry Pi. The adapter has five buttons that can be read from the RPi by polling, but there is no provision for button presses to cause interrupts. This is easily fixed, as I explain here.' | |
| len_msg = len(msg) - (lcd_columns - 1) | |
| for i in range(len_msg): | |
| lcd.clear() | |
| lcd.message(title + "\n") | |
| lcd.message(msg[i:i+lcd_columns] + "\n") | |
| time.sleep(0.4) | |
| lcd.clear() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment