Updated example, compatible with QMC6310N
This commit is contained in:
parent
709eb3ad7a
commit
0779b8289a
19 changed files with 114 additions and 123 deletions
|
|
@ -42,7 +42,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue