Main Site Documentation

TinyClr 0.2.0 and I2C


#1

Is it a way with tinyclr to detect error in i2c transfer ?
I’m looking to implement a scanner function to see which devices are on bus.


#2

@ Bauland - The WritePartial, ReadPartial, and WriteReadPartial methods return I2cTransferResult which has information on the number of bytes transfered and the transfer status (complete, partial, slave not acknowledged).


#3

@ John - I am curious if these work because last time I tried them they didn’t but that was a while back.


#4

@ Gus - They should. Write, Read, and WriteRead all delegate to the partial calls:


public void WriteRead(byte[] writeBuffer, byte[] readBuffer) => this.WriteReadPartial(writeBuffer, readBuffer);


#5

@ John - they do work, I tried them. I meant the response didn’t work for me. I did a partial write to a non existing device or an existing device resulted in the same return.


#6

@ John - They sould, but as Gary says thry don’t work as expected: if there is no device at address, status is full transfer instead of NACK.


#7

@ Bauland - Thanks, we’ll take a look


#8

@ Bauland - This is fixed for the next release.


#9

Good news ! I hope it is for soon. :clap:


#10

I think you would reply on button event thread ?
That’s what I said: “I know I can use a thread to read button’s state, as read function works but it is not really a clean solution.” But thanks anyway, I hope it will be corrected soon.


#11

Good job too. Everything’s working well now.
:clap: :clap: :clap: