This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Arduino Primo I2C bus problem

Hi, I try to mount some I2C devices at Arduino Primo but I can not get any results. I tried an I2C LCD that did not return any error but did not display any text. When I scan I2C devices I always return the same list, even if no external device is connected. Do you know if there is any configuration to run to use the bus? Thank you.

I2C scanner. Scanning ...
Found address: 9 (0x9)
Found address: 11 (0xB)
Found address: 13 (0xD)
Found address: 15 (0xF)
Found address: 17 (0x11)
Found address: 19 (0x13)
Found address: 21 (0x15)
Found address: 23 (0x17)
Found address: 25 (0x19)
Found address: 27 (0x1B)
Found address: 29 (0x1D)
Found address: 31 (0x1F)
Found address: 33 (0x21)
Found address: 35 (0x23)
Found address: 37 (0x25)
Found address: 39 (0x27)
Found address: 41 (0x29)
Found address: 43 (0x2B)
Found address: 45 (0x2D)
Found address: 47 (0x2F)
Found address: 49 (0x31)
Found address: 51 (0x33)
Found address: 53 (0x35)
Found address: 55 (0x37)
Found address: 57 (0x39)
Found address: 59 (0x3B)
Found address: 61 (0x3D)
Found address: 63 (0x3F)
Found address: 65 (0x41)
Found address: 67 (0x43)
Found address: 69 (0x45)
Found address: 71 (0x47)
Skip address: 72 (0x48)
Found address: 74 (0x4A)
Found address: 76 (0x4C)
Found address: 78 (0x4E)
Found address: 80 (0x50)
Found address: 82 (0x52)
Found address: 84 (0x54)
Found address: 86 (0x56)
Found address: 88 (0x58)
Found address: 90 (0x5A)
Found address: 92 (0x5C)
Found address: 94 (0x5E)
Found address: 96 (0x60)
Found address: 98 (0x62)
Found address: 100 (0x64)
Found address: 102 (0x66)
Found address: 104 (0x68)
Found address: 106 (0x6A)
Found address: 108 (0x6C)
Found address: 110 (0x6E)
Found address: 112 (0x70)
Found address: 114 (0x72)
Found address: 116 (0x74)
Found address: 118 (0x76)
Done.
Found 55 device(s).
Parents
  • Hi Martin, yes, this is code.

    #include <Wire.h>
    
    void setup() {
      Serial.begin (9600);
    
      // Leonardo: wait for serial port to connect
      while (!Serial)
      {
      }
    
      Serial.println ();
      Serial.println ("I2C scanner. Scanning ...");
      byte count = 0;
    
      Wire.begin();
      for (byte i = 8; i < 120; i++)
      {
        if (i != 72) // Questo indirizzo blocca Arduino Primo
        {
          Wire.beginTransmission (i);
          if (Wire.endTransmission () == 0)
          {
            Serial.print ("Found address: ");
            Serial.print (i, DEC);
            Serial.print (" (0x");
            Serial.print (i, HEX);
            Serial.println (")");
            count++;
            delay (1);  // maybe unneeded?
          } // end of good response
        }
        else
        {
          Serial.print ("Skip address: ");
          Serial.print (i, DEC);
          Serial.print (" (0x");
          Serial.print (i, HEX);
          Serial.println (")");
        }
      } // end of for loop
      Serial.println ("Done.");
      Serial.print ("Found ");
      Serial.print (count, DEC);
      Serial.println (" device(s).");
    }  // end of setup
    
    void loop() {}
    
Reply
  • Hi Martin, yes, this is code.

    #include <Wire.h>
    
    void setup() {
      Serial.begin (9600);
    
      // Leonardo: wait for serial port to connect
      while (!Serial)
      {
      }
    
      Serial.println ();
      Serial.println ("I2C scanner. Scanning ...");
      byte count = 0;
    
      Wire.begin();
      for (byte i = 8; i < 120; i++)
      {
        if (i != 72) // Questo indirizzo blocca Arduino Primo
        {
          Wire.beginTransmission (i);
          if (Wire.endTransmission () == 0)
          {
            Serial.print ("Found address: ");
            Serial.print (i, DEC);
            Serial.print (" (0x");
            Serial.print (i, HEX);
            Serial.println (")");
            count++;
            delay (1);  // maybe unneeded?
          } // end of good response
        }
        else
        {
          Serial.print ("Skip address: ");
          Serial.print (i, DEC);
          Serial.print (" (0x");
          Serial.print (i, HEX);
          Serial.println (")");
        }
      } // end of for loop
      Serial.println ("Done.");
      Serial.print ("Found ");
      Serial.print (count, DEC);
      Serial.println (" device(s).");
    }  // end of setup
    
    void loop() {}
    
Children
No Data
Related