Go Down

Topic: difficulty interfacing ak09970n with arduino mega2560 (Read 324 times) previous topic - next topic

aapatil

I just realized that I never thanked you all! (How inconsiderate of me :P ). You've all been very helpful :)

GolamMostafa

#16
Jul 21, 2018, 07:09 am Last Edit: Jul 21, 2018, 07:13 am by GolamMostafa
Can you please run the following codes and report if you have seen 0 (zero) on the Serial Monitor?

Code: [Select]
#include<Wire.h>
byte busStatus;

void setup()
{
   Serial.begin(9600);
   Wire.begin();
  
   do
   {
      Wire.beginTransmission(AKAddress);  //enter actual 7-bit value for AKAddress
      busStatus = Wire.endTransmission();
    }
    while(busStatus != 0x00);
    
    Serial.println(busStatus, HEX);  //prints 0
    Serial.println("Slave has responded to its address..!");  
}

void loop()
{

}

aapatil

I have been receiving a 2- "2:received NACK on transmit of address"

aapatil

Also, would the Pro Mini 3.3V fix my issue with the 5V output: https://www.amazon.com/Diymall-Atmega328-Atmega328p-Arduino-Esp8266/dp/B00NWF2DAU/ref=sr_1_6?s=electronics&ie=UTF8&qid=1532124680&sr=1-6&keywords=arduino+mini+3.3v

GolamMostafa

I have been receiving a 2- "2:received NACK on transmit of address"
Now, it is confirmed that the sensor is not seen by the host at the specified slaveAddress.

Go Up