The original posting of the problem is here:
http://forums.netdui...tion-with-rfid/
I know that this double posting isn't good practice but when browsing the VB.Net part of the forum, I noticed that the topic I²C came up in the dedicated VB pages 3 or 4 times over the past months with no answer at all or just a vague code snippet at best. So I take my chance again by posting it on the N+ pages, which seem to be read and replied to more.
VB support is what brought me to Netduino so I'd really like to get my project going. It's been over three days and numerous hours of trying to get something into /out of the SL030 RFID reader over I²C.
Here's my code:
Dim cfg As New I2CDevice.Configuration(80, 100) Dim iic As New I2CDevice(cfg) Dim outbytes() As Byte = New Byte() {} Dim inbytes() As Byte = New Byte(7) {} Dim i As Integer = 0 Dim sInput As String = "" outbytes = New Byte() {80, 1, 1} Dim write_transaction As I2CDevice.I2CTransaction = I2CDevice.CreateWriteTransaction(outbytes) Dim read_transaction As I2CDevice.I2CTransaction = I2CDevice.CreateReadTransaction(inbytes) Dim transActionList As I2CDevice.I2CTransaction() = New I2CDevice.I2CTransaction() {write_transaction, read_transaction} i = iic.Execute(transActionList, 10) Debug.Print(i.ToString) Thread.Sleep(50) For Each item As Byte In inbytes sInput &= item.ToString & " " Next Debug.Print(sInput)
This code tells me that 3 bytes have been sent as expected (outbytes array) and that nothing comes into the inbytes array since it all remain bytes set to zero by the declaration of the array.
Right now there are no external pull ups engaged, since WITH pull ups I get '1' for bytes sent and WITHOUT I get the expected 3 bytes sent.
I've searched everywhere and have tried numerous things. It drives me crazy.
I'd be really grateful if someone could help me out? Thanks a lot!
- Franki