Gast
#1151234
Hallo zusammen! Ich verzweifle gerade an dem i2c temperatur und Feuchte Sensor DigiPicco von IST-AG Ich kann mit einfachen Bascom Programm die glieferten Bytes lesen. Ich versuche vergeblich sei Tagen das Code in C umzusetzen. Ohne Erfolg. Prozessor : ATmega 128 CPU: 7372800UL Kann jemand mir Helfen. Danke!! $regfile = "m128def.dat" $crystal = 7372800 Config Com1 = 38400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Config Com2 = 38400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 'Open "com1:" For Binary As #1 Open "com2:" For Binary As #2 Print #2 , "test serial port OK!" Config Scl = Portd.0 Config Sda = Portd.1 Dim B1 As Byte , B2 As Byte Dim W As Word At B1 Overlay I2cinit Dim B As Byte Dim I2ctemp As Byte 'Sensor-Addresse Const SensorAdd = &B11110001 Waitms 25 I2cstart I2cwbyte Sensoradd '---16 Byte ausgeben--- For B = 1 To 16 I2crbyte I2ctemp , Ack Print #2 , I2ctemp Wait 1 Next B End