#made by DIEGO ;-)
#----Import de Bibliothèques----------------------------------------------
from machine import *
from time import sleep_ms
from lcd_api import LcdApi
from pico_i2c_lcd import I2cLcd
#----Sorties Ecran LCD----------------------------------------------
I2C_ADDR = 0x27 #adresse I2C
I2C_NUM_ROWS = 2 #nombre de lignes
I2C_NUM_COLS = 16 #nombre de colonnes
i2c = I2C(1, sda=Pin(2, Pin.OUT), scl=Pin(3, Pin.OUT), freq=400000)
lcd = I2cLcd(i2c, I2C_ADDR, I2C_NUM_ROWS, I2C_NUM_COLS)
table_hexa = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A","b","C","d","E","F"]
#-----Conditions initiales---------------------------------------------
#----Début du programme----------------------------------------------
print(i2c.scan()) #scanner un bus I2C et renvoyer une liste d'adresses I2C valides qui sont connectées à ce bus
while True:
for i in range (2):
lcd.move_to(0,i)
for j in range (16):
lcd.putstr(table_hexa[j])
sleep_ms(500)
lcd.clear()
lcd.move_to(0,0)
lcd.putstr("int hex Ascii")
for i in range(256):
lcd.move_to(0,1)
lcd.putstr(str(i))
lcd.move_to(5,1)
lcd.putstr(hex(i)[2:])
lcd.move_to(10,1)
lcd.putstr(chr(i))
lcd.clear()