program include_moduli dim LCD_RS as sbit at RA2_bit LCD_EN as sbit at RA3_bit LCD_D4 as sbit at RB0_bit LCD_D5 as sbit at RB1_bit LCD_D6 as sbit at RB2_bit LCD_D7 as sbit at RB3_bit LCD_RS_Direction as sbit at TRISA2_bit LCD_EN_Direction as sbit at TRISA3_bit LCD_D4_Direction as sbit at TRISB0_bit LCD_D5_Direction as sbit at TRISB1_bit LCD_D6_Direction as sbit at TRISB2_bit LCD_D7_Direction as sbit at TRISB3_bit main: ANSEL = 0 ' Configura AN pins come I/O digitali option_reg.7=0 ' pull up on txt1 = "FRANCESCO IT9DPX" Lcd_Init() ' Initialize Lcd Lcd_Cmd(_LCD_CLEAR) ' Clear display Lcd_Cmd(_LCD_CURSOR_OFF) ' Cursor off Lcd_Out(2,1,txt1) ' Write text in first row Delay_ms(2000) Lcd_Out(1,1,"2-5 scorre memor") ' Write text in first row Lcd_Out(2,1,"* inser. # fine.") ' Write text in second row Delay_ms(3000) control_code = %10100000 'inserire qui il control_code del dispositivo i2c indirizzo_soft = 480 ' inserire qui indirizzo iniziale eeprom indirizzo_hard = 1 ' inserire qui indirizzo hardware eeprom indirizzo_hard = indirizzo_hard << 1 nr_chr = 16 'inserire qui il numero di caratteri da leggere in successione ripeti: Delay_ms(10) leggo_ee Lcd_Out(1,1,txt1) ' Write text in first row anc_tastiera: tastiera4x4 if ta=16 then goto anc_tastiera end if if ta=2 then indirizzo_soft = indirizzo_soft + 16 end if if ta=5 then indirizzo_soft = indirizzo_soft - 16 end if if ta=10 then gosub inserisci scrivo_ee end if goto ripeti '====== inserisci numero da 10 cifre ===== inserisci: txt1 = " " Lcd_Out(2,1,txt1) ' Write text in second row x = 0 rip_tastiera: tastiera4x4 if ta=16 then goto rip_tastiera end if if ta=11 then return end if txt1[x] = ta + 48 Lcd_Out(2,1,txt1) ' Write text in second row x=x+1 if x < 10 then goto rip_tastiera end if return '====== fine inserimento numero da 10 cifre ===== end.