Posts: 23
Joined: Thu Mar 22, 2018 3:19 am

wiringPi.Net and I2C using C#

Mon Mar 26, 2018 12:54 am

Just in case anyone else is searching for answers.'s I2C functionality seems to be incomplete. It includes 16 bit reads through I2C.wiringPiI2CReadReg16() but there are no overloads to get signed words or to deal with endian type. Not having dealt with I2C in years I was almost starting from scratch and wasn't thinking about this - spent hours trying to figure out why the numbers I was getting made no sense.

So use I2C.wiringPiI2CReadReg8() twice and sort out the sign and/or endian-ness yourself.

Return to “Other programming languages”