You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using a normal I2C scanner code, i keep getting random addresses detected. i tried with another core (roger's core) with the same hardware and code and it works but when i switch to the stm32duino core it doesn't work anymore.
nDevices = 0;
for(address = 1; address < 127; address++) {
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0) {
Serial1.print("I2C device found at address 0x");
if (address < 16)
Serial1.print("0");
Serial1.println(address, HEX);
nDevices++;
}
else if (error == 4) {
Serial1.print("Unknown error at address 0x");
if (address < 16)
Serial1.print("0");
Serial1.println(address, HEX);
}
using a normal I2C scanner code, i keep getting random addresses detected. i tried with another core (roger's core) with the same hardware and code and it works but when i switch to the stm32duino core it doesn't work anymore.
code:
`#include <Wire.h>
void setup() {
Serial1.begin(115200);
Wire.begin();
Serial1.println("\nI2C Scanner");
}
void loop() {
byte error, address;
int nDevices;
Serial1.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++) {
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
}
if (nDevices == 0)
Serial1.println("No I2C devices found");
else
Serial1.println("done");
delay(5000); // wait 5 seconds for next scan
}`
The text was updated successfully, but these errors were encountered: