Hi ihr!

Ich habe diesen Thread in der letzten Zeit irgendwie vernachlässigt, sorry.

Hier mein Quelltext:

Function Clearlcd() As Byte

I2csend Lcddataaddr , 1 'Clear
Waitms Default_i2c_delay_time


I2csend Lcdcntrladdr , 1 'Enable...
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 0 'Enable...
Waitms Default_i2c_delay_time


End Function



Function Startlcd() As Byte

I2csend Lcddataaddr , 56 'Mit 2 Zeilen initialisieren...
Waitms 5


I2csend Lcdcntrladdr , 1 'Enable...
Waitms 5

I2csend Lcdcntrladdr , 0 'Enable...
Waitms 5



I2csend Lcddataaddr , 12 'Einschalten, kein Cursor, kein blinken, siehe Datenblatt LCD für Werte...
Waitms 5


I2csend Lcdcntrladdr , 1 'Enable...
Waitms 5

I2csend Lcdcntrladdr , 0 'Enable...
Waitms 5



I2csend Lcddataaddr , 2 'Cursor HOME
Waitms 5


I2csend Lcdcntrladdr , 1 'Enable...
Waitms 5

I2csend Lcdcntrladdr , 0 'Enable...
Waitms 5


End Function



Function Lcdprint() As Byte
Dim Sign As String * 1 'Variablendeklaration
Dim Prnt As Byte
Dim Schlvar3 As Byte 'Schleifenvariablen...
Dim Schlvar4 As Byte



For Schlvar3 = 1 To 20 'Schleife für die ersten 20 Zeichen...

Sign = Mid(lcdupline , Schlvar3 , 1) '1 zeichen auslesen, mittels mid
Prnt = Asc(sign) 'Zeichen in ASCII-Wert umwandeln...


I2csend Lcddataaddr , Prnt 'Per I²C an den Datenchip legen (PCF8574)
Waitms Default_i2c_delay_time 'Besteimmte Zeit warten...


I2csend Lcdcntrladdr , 4 'Enable...
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 5
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 4
Waitms Default_i2c_delay_time

Next



I2csend Lcddataaddr , 192 'Steuerzeichen 192 für Zeilenwechsel...
Waitms Default_i2c_delay_time


I2csend Lcdcntrladdr , 0
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 1 'Enable...
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 0
Waitms Default_i2c_delay_time



For Schlvar4 = 1 To 20 '2te Schleife für die 2ten 20 Zeichen, untere Linie...

Sign = Mid(lcdlowline , Schlvar4 , 1) 'Zeichen holen...
Prnt = Asc(sign) 'Wie oben umwandeln...


I2csend Lcddataaddr , Prnt 'Siehe oben...
Waitms Default_i2c_delay_time


I2csend Lcdcntrladdr , 4
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 5
Waitms Default_i2c_delay_time

I2csend Lcdcntrladdr , 4
Waitms Default_i2c_delay_time

Next


End Function

Lcddataaddr it ein define, das die Addresse des 8574ers angibt, an dem von 0-7 DB0-DB7 hängen;
lcdcntrladdr ist das gleiche für den Baustein mit RS/RW und E.

Und i2cdelay ist die wartezeit.

Ich glaube aber kaum, dass ihr daraus schlau werdet...

Liebe Grüße und viel Glück!