#include <Wire.h>
void setup() {
Serial.begin(9600);
}
void loop() {
for (;;) {
Serial.println("Begin");
for (int a=1; a<128; a++) {
Wire.begin();
Wire.beginTransmission(a);
int error = Wire.endTransmission(true);
if (error == 0) Serial.println(a);
}
Serial.println("End");
delay(1000);
}
}
Wire.endTransmission() should return a non-zero error value if the address supplied to Wire.beginTransmission() is not a valid device. On other platforms, such as the Arduino Zero board, it prints just the addresses of any I2C devices on the bus. On the MAX32620FTHR it prints every number from 1 to 127.
I uploaded the program by exporting it with Export compiled Binary and pasted it onto the BOOTLOADER disk.
The following I2C port scanner demonstrates this:
Wire.endTransmission() should return a non-zero error value if the address supplied to Wire.beginTransmission() is not a valid device. On other platforms, such as the Arduino Zero board, it prints just the addresses of any I2C devices on the bus. On the MAX32620FTHR it prints every number from 1 to 127.
I uploaded the program by exporting it with Export compiled Binary and pasted it onto the BOOTLOADER disk.