Updated example, compatible with QMC6310N

This commit is contained in:
lewisxhe 2026-01-14 16:10:35 +08:00
commit 0779b8289a
19 changed files with 114 additions and 123 deletions

View file

@ -43,7 +43,11 @@ void setup()
setupBoards();
if (!qmc.begin(Wire, QMC6310_SLAVE_ADDRESS, I2C_SDA, I2C_SCL)) {
// For QMC6310U, the device address is 0x1C.
// For QMC6310N, the device address is 0x3C.
// The sensor device address is provided by the setupBoards I2C scanner.
extern uint8_t mag_address;
if (!qmc.begin(Wire, mag_address, I2C_SDA, I2C_SCL)) {
Serial.println("Failed to find QMC6310 - check your wiring!");
while (1) {
delay(1000);