Code:
'=========================lcd initialization====================================
INIT:
I2CWrite SDA,SCL,I2CDevice,[DC,$AE]'Display Off
pause 10
I2CWrite SDA,SCL,I2CDevice,[DC,$20,$10]' Page adressing mode
I2CWrite SDA,SCL,I2CDevice,[DC,$D3,$00]' Set offset to 0
I2CWrite SDA,SCL,I2CDevice,[DC,$40]' Set display start line 0
I2CWrite SDA,SCL,I2CDevice,[DC,$81,$FF]' Set contrast to full
I2CWrite SDA,SCL,I2CDevice,[DC,$A4]' display on continue
I2CWrite SDA,SCL,I2CDevice,[DC,$A6]' $A6=NORMAL MODE;$A7=INVERSE MODE
I2CWrite SDA,SCL,I2CDevice,[DC,$A1]' set column 127 as start
i2cwrite sda,scl,I2CDevice,[DC,$C8]'Flip display vertically ****
'above 2 lines for arranging screen direction, deleting them will
'turn the display direction 180 degree
I2CWrite SDA,SCL,I2CDevice,[DC,$AF]'Display On
pause 10
'===============================================================================
You don't need to send control commands in your main routine unless you want to really control the screen, delete them. Put some delay after sending 00 / 0f to screen,
Bookmarks