vielen Dank für die Aufnahme.
Mit diesem Arduino-Programm wird die Uhr PCF8583 noch gefunden:
Code: Alles auswählen
/*********
Rui Santos
Complete project details at https://randomnerdtutorials.com
*********/
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ ) {
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0) {
Serial.print("I2C device found at address 0x");
if (address<16) {
Serial.print("0");
}
Serial.println(address,HEX);
nDevices++;
}
else if (error==4) {
Serial.print("Unknow error at address 0x");
if (address<16) {
Serial.print("0");
}
Serial.println(address,HEX);
}
}
if (nDevices == 0) {
Serial.println("No I2C devices found\n");
}
else {
Serial.println("done\n");
}
delay(5000);
}
Code: Alles auswählen
13:40:49.577 -> Scanning...
13:40:49.648 -> I2C device found at address 0x50
13:40:49.648 -> done
13:40:49.648 ->
13:40:54.656 -> Scanning...
13:40:54.689 -> I2C device found at address 0x51
13:40:54.724 -> done
13:40:54.724 ->
Code: Alles auswählen
Micropython
Code: Alles auswählen
# Scanner i2c en MicroPython | MicroPython i2c scanner
# Renvoi l'adresse en decimal et hexa de chaque device connecte sur le bus i2c
# Return decimal and hexa adress of each i2c device
# https://projetsdiy.fr - https://diyprojects.io (dec. 2017)
import machine
#i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4)) #ESP8266
i2c = machine.SoftI2C(sda=machine.Pin(21), scl=machine.Pin(22)) #ESP32
print('Scan i2c bus...')
devices = i2c.scan()
if len(devices) == 0:
print("No i2c device !")
else:
print('i2c devices found:',len(devices))
for device in devices:
print("Decimal address: ",device," | Hexa address: ",hex(device))
Und obwohl dasselbe Programm die PCA9685 PWM Driver Karte über I2C korrekt findet, meldet es aber “ No i2c device !“, wenn stattdessen die Uhr PCF8583 angeschlossen ist.
HW (jeweils links ESP32, rechts I2C-Device):
- PCA9685 PWM Driver Karte (5V = VCC, GND=GND, PIN21=SDA, PIN22=SCL)
- PCA9685 PWM Driver Karte (3.3V = VCC, GND=GND, PIN21=SDA, PIN22=SCL)
- ESP32 D1 Mini NodeMCU von AZ-Delivery (D1 Mini ESP32)
Lieben Gruß
Äd