Notifications
Clear all

I2C addresses, scanners and other infos

3 Posts
3 Users
1 Reactions
3,456 Views
(@zeferby)
Member
Joined: 6 years ago
Posts: 355
Topic starter  

I think this contains useful infos with good links to address lists and several scanners, as well as tips about I2C :

https://www.totalphase.com/support/articles/200349176-7-bit-8-bit-and-10-bit-I2C-Slave-Addressing

https://learn.adafruit.com/i2c-addresses/the-list

Eric


   
byron reacted
Quote
(@pugwash)
Sorcerers' Apprentice
Joined: 6 years ago
Posts: 923
 

@zeferby

This is the scanner that I use regularly!

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#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++)
  {
    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
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}


   
ReplyQuote
byron
(@byron)
No Title
Joined: 6 years ago
Posts: 1212
 

Thanks for sharing that tip @ ZeFerby it will probably save me some future grief as I was not aware of all that shenanigans and your research and shared information is appreciated.


   
ReplyQuote