maybe but in conjunction with
I found this,if i remember correctly somewhere related to this specific sensor.
Code:
tempir = (temp.highbyte << 8) + temp.lowbyte
i2cread SDA, SCL,addr,reg,[temp.lowbyte,temp.highbyte] ' reg = $07
its not useful in any way
all this achieves is exactly nothingNow what is wrong with the I2C command?
all that's neededCode:reg = $07 ' based on the datasheet $07 is the object's temp grave doubts about all of this it looks like some mishmash of a C code method where no read/write register command exists as it does in pbp addr = %10110100 ' $B4 binary value: %10110100 i2cwrite SDA, scl, addr ' send write command, shift the address B4, 8 bits where LSB is W = 0 i2cwrite sda, scl, reg ' register is $07 i2cwrite sda, scl, addr,reg, [some data of some sort] ' register is $07 ;would be the normal way if you had any data to write totally bogus in pbp bit 0 should always be 0 addr = %10110101 ' $B5 Binary value: %10110101 a form of torture to i2c chips with an incomplete transaction i2cwrite sda, scl, addr ' sends read command, shift the address B5, 8 bits where LSB is R = 1, clock idles low
reg = $07
addr = %10110100
i2cread SDA, SCL,addr,reg,[temp.lowbyte,temp.highbyte] ' reg = $07 ;would be the normal pbp way




Bookmarks