Created
April 20, 2017 05:53
-
-
Save netomarin/490ab2af4f5aefb80561aef15de9c2f5 to your computer and use it in GitHub Desktop.
Exemplo de uso de display LCD I2C 20x4 com módulo PCF8574 em Python para Raspberry Pi
This file contains 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
# Classe do branch que é compativel com o modulo PCF8574 | |
import Adafruit_CharLCD.PCF_CharLCD as LCD | |
# Valores de configuracao | |
address = 0x3f | |
busnum = 1 | |
lines = 4 | |
cols = 20 | |
# E se estiver usando um 2x16 | |
#lines = 2 | |
#cols = 16 | |
# Inicializacao da classe que realizara a comunicacao | |
lcd = LCD.PCF_CharLCD(0, address=address, busnum=busnum, cols=cols, lines=lines) | |
# Iniciando com a limpeza da tela | |
lcd.clear() | |
# Exibindo uma simples mensagem | |
lcd.message(' Hello from') | |
# Mudanca de linha com \n | |
lcd.message('\n Neto Marin') | |
# Ou definindo a posicao do cursor para centralizar | |
lcd.set_cursor(5,2) | |
lcd.message('@netomarin') | |
# E tambem para posicionar no inicio da linha | |
lcd.set_cursor(0,3) | |
lcd.message('www.netomarin.com.br') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment