Arduino Nano V3 only runs sketch correctly after hitting reset or starting serial monitor

  • VCC pin from both sensors to either 3.3V or 5V. If you are using an Arduino Uno, use the 5V pin.
  • GND pin from both sensors to the GND pin on Arduino.
  • SCK pin from both sensors to the I2C clock SCL pin 28 on Arduino nano. On the Arduino Uno that would be the pin A5.
  • SDI pin from both sensors to the I2C data SDA pin 27 on Arduino nano. On the Arduino Uno that would be the pin A4.
  • Leave the CS pin from both sensors unconnected.
  • Leave the SDO pin from only one sensor unconnected.
  • Connect the SDO pin from the other sensor to GND.