Hallo,
ich habe jetzt den Sensor einfach an PD4 und 5 gehangen und das Programm entsprechend modifiziert:
Code:
$regfile = "M8def.dat"
$crystal = 16000000
$hwstack = 32
$swstack = 10
$framesize = 40
$baud = 9600
Config Sda = Portd.5
Config Scl = Portd.4
Dim Highbyte As Byte
Dim Lowbyte As Byte
Config I2cdelay = 20
I2cInit ' Zu Beginn alles in die richtige Ausgangslage bringen
I2cstart
I2cwbyte 84
I2cwbyte 182
I2cstop
Print Err
I2cstart
I2cwbyte 85
I2crbyte Highbyte
I2crbyte Lowbyte , Nack
I2cstop
Print Err
Print Highbyte
Print Lowbyte
Do
Loop
End
Plötzlich geht es. Aber warum?
Lesezeichen