Hallo Matthias96,
ich habe folgende Leseroutine für den CMPS03:
Code:
'CMPS03-Leseroutine:
Function Cmps03(byval Register As Byte) As Word
Local Hdata As Byte , Ldata As Byte
Disable Interrupts
I2cstart
I2cwbyte &HC0 , Ack
I2cwbyte Register
Waitms 10
I2cstart
I2cwbyte &HC1 , Ack
If Register = 2 Then
I2crbyte Hdata , Ack '16-Bit lesen
Else
Hdata = 0
End If
I2crbyte Ldata , Nack
Cmps03 = Hdata * 256
Cmps03 = Cmps03 + Ldata
I2cstop
Waitms 10
Enable Interrupts
End Function
Vielleicht klappt's damit?
Gruß Dirk
Lesezeichen