|
发表于 2022-9-19 11:13:01
|
显示全部楼层
// Serial.println("I2C 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.
//
// i2c.beginTransmission(address);
// error = i2c.endTransmission();
//
// if (error == 0) {
// Serial.print("I2C device found at address 0x"); Serial.print(address, HEX); Serial.print(" !\r\n");
// nDevices++;
//
// } else if (error == 4) {
// Serial.print("Unknow error at address 0x"); Serial.print(address, HEX); Serial.print(" !\r\n");
// }
// }
// if (nDevices == 0) {
// Serial.println("No I2C devices found\r\n");
// } else {
// Serial.println("done\r\n");
// } |
|