Main Site Documentation

SoftwareI2C 4.3R5 G120 Read Error


#1

The following method running on MF4.3R5 return 0 while it should be 0x13.
MF4.2R5 works well


 private int ReadByteFromRegister(int register)
            {
 #if MF_FRAMEWORK_VERSION_V4_2
                var writeBuffer = new byte[1];
                writeBuffer[0] = (byte)(register | 0x80);
                var readBuffer = new byte[1];
                if (_sensor.Write(writeBuffer, 0, 1) != writeBuffer.Length)
                {
                    throw new Exception("IO Write error TCS3414");
                }

                if (_sensor.Read(readBuffer, 0, 1) != readBuffer.Length)
                {
                    throw new Exception("IO Read error TCS3414");
                }
                return readBuffer[0];
 #endif
 #if MF_FRAMEWORK_VERSION_V4_3
                _sensor.WriteByte((byte) (register | 0x80));
                return _sensor.ReadByte();
 #endif
            }


#2

Have you tried this method: https://www.ghielectronics.com/downloads/man/Library_Documentation_v4.3/html/676bf04d-3d3e-b192-1c18-972443a74c31.htm ?


#3

@ iamin - Thanks for the message. No, i didn’t tried that one, If i can find some time i will try… I have to move on so i stay with 4.2 for now