Advertisement
tdrobotica

Proyecto pantalla oled

Dec 29th, 2021 (edited)
1,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. from machine import Pin, I2C, ADC
  2. import ssd1306
  3. from time import sleep
  4. #Configurar interfaz I2C a puerto 1, pines
  5. # sda GPIO21, scl GPIO22, direccion por defecto 0x3C
  6. i2c = I2C(-1, sda=Pin(21), scl=Pin(22))
  7.  
  8. display = ssd1306.SSD1306_I2C(128, 64, i2c)
  9. def main():
  10.        #limpiar la LCD
  11.         display.fill(0)
  12.         #escribir
  13.         display.text('Bienvenidos al', 12, 0,20)#posicion x, posicion y
  14.         display.text('Sistema TecPro', 10, 15,20)
  15.         display.text('Nivel J', 40, 30,20)
  16.         #mostrar en lcd
  17.         display.show()
  18.         #tasa de actualizacion
  19.         sleep(0.1)
  20. if __name__ == "__main__":
  21.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement