This gives an error:
outbytes = New Byte() {80, 1, 1} IIC.WriteRead(outbytes, inbytes)And this too:
outbytes = New Byte() {161, 1, 1} IIC.WriteRead(outbytes, inbytes)
If I split up the reading from the writing, I get beyond this just fine:
outbytes = New Byte() {80, 1, 1} IIC.Write(outbytes)
But then the exception is thrown right after when I try to read into 'inbytes':
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll Exception was thrown: System.ArgumentException
So it seems it goes bad when reading.
My problem is A) being new to Netduino and embedded in general, B ) never used I²C and C) not familiar with this particular device (RFID reader).
This means a lot of unknowns in the equation, and I don't know how to code up I²C straight from the µF in VB. Is my VB code bad or do I just send or expect the wrong things from the slave device?
For point B I try to use the Toolbox I2C-helper but I'm doing something wrong obviously.
For point C here's the device (+datasheet): http://www.stronglin...ules/sl030.html
I found some assembler-ish or C-like code samples to interface this device over I²C and hoped to understand it and 'translate' it to my needs but I must admit I don't really get what I'm seeing.
I'm hoping someone out here could show me the way or guide me through the learning process? I'd really appreciate that.
- Franki
EDIT: opened a new topic for this HERE since I think I made a breakthrough.