I’ve done a fair bit with I2C before however not before with Gadgeteer … basically I have a lovely sensor that is not talking to my mainboard.
I just need a sanity check in case I missing something
It’s I2C so I’ve done type “I”, of course
As with type I, pin 3 is GPIO and not shared where Pin 8 (SDA - data) is shared as is Pin 9 (SCL - clock)
Also included “Gadgeteer.DaisyLink” assembly reference for 2.4.2 builds.
Should be all OK and I’ve check with my multi-meter on my breadboard … see picture.
VCC is getting 3.3V, Ground is grounded Chip selected is tied high for the right address.
Both SDA and SCL are pulled high with resistors.
Also I’ve continuity from the breakout board pin all the way to the Gadgeteer pin.
Originally tried to have all the code in the module, however as it was not working brought it into the program for quicker testing. I guess that makes the module part redundant
GT.Socket socket = GT.Socket.GetSocket( 2, // socked connected true, // throw if socket invalid null, // not part of a module null); // socket label ushort sensorAddress = 0x1D; i2c = new GTI.I2CBus( socket, // socket sensorAddress, // ADXL354 device ID 100, // 100 Hz null); // not part of a module byte writebuff = new byte; // write buffer byte readbuff = new byte; // read buffer writebuff = 0; // want register 0 which is device ID int bytesTransfered = i2c.WriteRead( writebuff, // write register I want readbuff, // read data containing device ID 1000);
All looks relatively simple however no joy
Question: Have I missed something obvious?
Thanks for your time!