Zitat von
Klebwax
0x13D kann nicht sein.
I2C Adressen haben 7 Bit, der Maximalwert ist also 0x7f. 0x13d braucht mehr als 8 Bit.
MfG Klebwax
ich würde evtl auch noch mal die I2C Adresse(n) checken.
Probier mal mein Programm
Code:
// --------------------------------------
// i2c_scanner
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
#define ESP_SDA 4 //GPIO4=D2 SDA ESP8266 default
#define ESP_SCL 5 //GPIO5=D1 DCL ESP8266 default
byte error, address;
int nDevices;
void setup()
{
// Wire.begin(ESP_SDA,ESP_SCL); // ESP8266 if not default
Wire.begin(); // AVR, ARM, Leonardo, ESP8266 default
Serial.begin(115200);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
Serial.println("\nScanning...");
}
void loop()
{
nDevices = 0;
for(address = 0; address < 128; address++ )
{
if (address%16 == 0) {
Serial.println();
Serial.print( (address+1)/16);
Serial.print(" ");
}
if(address==0 || address==127) {
Serial.print("** ");
continue;
}
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0) // no error, device found
{
if (address<16) Serial.print("0");
Serial.print(address,HEX); Serial.print(" ");
nDevices++;
}
else if (error==4) // unknown error or conflicting
{
Serial.print("?? ");
}
else
{
Serial.print("-- "); // nothing found
}
}
Serial.println();
Serial.print("found: "); Serial.print(nDevices); Serial.print(" devices \n");
delay(10000);
}
Lesezeichen