I am trying to get the default code for the SparkFun IMU Shield to run on my Photon.
The frustrating thing is that it DID work once but never again… : (
Here is what I can report:
I have the Photon mounted (correctly) on top of the IMU shield…
USB from my mac laptop (which is plugged in).
Photon is online and works with other sketches no problem (like blink LED)
I have the latest firmware (4.9)
I load LSM9DS1_BASIC_I2C
Code seems to flash onto device OK
Photon breaths blue 5 times
Then Photon breathes green
Serial port reads:
Failed to communicate with LSM9DS1.
Double-check wiring.
Default settings in this sketch will work for an out of the box LSM9DS1 Breakout, but may need to be modified if the board jumpers are.
I see all this in the code but I am stumped…
I have also tried providing power to the the IMU shield from my Arduino just in case the USB isn’t providing enough power but no luck…
The board now does NOT switch from breathing blue to green - it stays blue!
However - the serial monitor still reports:
Failed to communicate with LSM9DS1.
Double-check wiring.
Default settings in this sketch will work for an out of the box LSM9DS1 Breakout, but may need to be modified if the board jumpers are.
I have spent hours and hours trying everything I can. I even bought two different SparkFun ADXL breakout boards and tried hooking them up to the Photon bit no luck.
In those cases the board always returned 0,0,0 on the serial port. However the photon breathed blue the entire time.
Failed to communicate with LSM9DS1.
Double-check wiring.
Default settings in this sketch will work for an out of the box LSM9DS1 Breakout, but may need to be modified if the board jumpers are.
The person in this thread here had a very similar experience and ended up switching to Arduino. I REALLY want to stay with the Photon as I need the easy web connectivity.
I don’t understand how to even test the board. I have a simple digital multimeter but that’s it.
I am powering from a usb port on my macbook laptop.
I’ve no idea what can be wrong there.
I tooe my two boards, plugged the preprogrammed (with unaltered I2C sample) Photon in, plugged the Photon into my PCs USB port and off it went.
So my only suggestions left are rather stupid and might seem insulting (sorry, but I can’t see any other options )
Double check that the Photon is plugged in correctly.
Try a different USB port and/or PC.
Shoot a photo of your setup and post here.
Have you got another Photon to try?
Have a test on the I2C pins (D0/D1) if they still work as standard D pins.
You don’t happen to have a Particle Internet Button (which also sports an ADXL), to test your Photon?
I know how frustrating this must be, so we do want to get you out of this pickle.
@Samsterism, the IMU board is setup for I2C by default so trying SPI code will not work UNLESS you have modified the board. Did you?
I also have one of these shields so I will test with the latest firmware. One thing I usually do when I have I2C problems is first check that there are pull-ups on the I2C lines. The IMU board has them so that should be ok. Second, I run an I2C device scanner to make sure the addresses used in the library are actually the correct ones. This also tells me if the device can be "seen" on the bus. You can find some scanner code here:
What are you developing with - web IDE, Particle CLI or DEV? I should be able to test tonight and report my findings.
@Samsterism, I had given you a link to working code!! The Wire library is included in the Particle firmware and dosen’t need to be included like Arduino. The OneWire library has nothing to do with Wire so you can remove that.
As @joe4465 pointed out, you cannot expect a board with headers to work without soldering those headers. Make sure you place the short side of the header pins UNDER the board and solder the pins on the TOP side of the IMU board and NOT the bottom side. The way you have the headers in your pictures is incorrect.
Here is the code I had linked to, just to be sure we are testing with the same code:
// --------------------------------------
// i2c_scanner
//
// http://playground.arduino.cc/Main/I2cScanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
void setup()
{
Wire.begin();
Serial.begin(9600);
delay(10000);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknow error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}