Equivalent code in vb6 ???
Dim d1 As UInteger
Dim d2 As UInteger
Dim d3 As UInteger
Dim d4 As UInteger
Dim d5 As UInteger
Dim d6 As UInteger
Dim i2c_address As Byte = &H53
If i2c_Initialize(I2CIRQ_DISABLE) = False Then
Console.Write("FALSE!! {0}" & vbLf, roboio_GetErrMsg())
Return -1
End If
i2c0_SetSpeed(I2CMODE_FAST, 400000L)
i2c0master_StartN(i2c_address,I2C_WRITE,2)
i2c0master_WriteN(&H2d)
i2c0master_WriteN(&H28)
wait_ms(100)
i2c0master_StartN(i2c_address,I2C_WRITE,2)
i2c0master_WriteN(&H31)
i2c0master_WriteN(&H08)
wait_ms(100)
i2c0master_StartN(i2c_address,I2C_WRITE,2)
i2c0master_WriteN(&H38)
i2c0master_WriteN(&H00)
wait_ms(100)
Do
i2c0master_StartN(i2c_address, I2C_WRITE, 1)
i2c0master_SetRestartN(I2C_READ, 6)
i2c0master_WriteN(&H32)
d1 = i2c0master_ReadN()
d2 = i2c0master_ReadN()
d3 = i2c0master_ReadN()
d4 = i2c0master_ReadN()
d5 = i2c0master_ReadN()
d6 = i2c0master_ReadN()
Console.Write("Acc of X-axis :{0,5:D}" & vbLf, If(((d2 And &H80) <> 0), ((((Not 0))>>16)<<16) Or ((d2<<8)+d1), (d2<<8)+d1))
Console.Write("Acc of Y-axis :{0,5:D}" & vbLf, If(((d4 And &H80) <> 0), ((((Not 0))>>16)<<16) Or ((d4<<8)+d3), (d4<<8)+d3))
Console.Write("Acc of Z-axis :{0,5:D}" & vbLf, If(((d6 And &H80) <> 0), ((((Not 0))>>16)<<16) Or ((d6<<8)+d5), (d6<<8)+d5))
wait_ms(100)
Loop While Console.ReadKey(True).KeyChar <> 27
i2c_Close()
Return 0