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
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.15
arduino-esp32 2.0.0 RC-1 installed via the boards manager
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
Upload sketch, reboot and open Serial Monitor.
I believe the issue is being caused by the esp32 implementation of the TwoWire::endTransmission() function expecting the user to call Wire.write() prior to calling Wire.endTransmission()
#include<Adafruit_LIS3DH.h>Adafruit_LIS3DHlis=Adafruit_LIS3DH();
voidsetup() {
Serial.begin(115200);
while (!Serial);
if (! lis.begin(0x19)) { // change this to 0x19 for alternative i2c addressSerial.println("Couldnt start LIS3DH");
while (1) yield();
}
Serial.print("Range = "); Serial.print(2 << lis.getRange());
Serial.println("G");
}
voidloop() {
// put your main code here, to run repeatedly:
}
This seems like an OK workaround:
Adding the following lines to the detected() function in Adafruit_I2CDevice.cpp
boolAdafruit_I2CDevice::detected(void) {
// Init I2C if not done yetif (!_begun&& !begin()) {
return false;
}
// A basic scanner, see if it ACK's_wire->beginTransmission(_addr);
#ifdefESP32// ESP32 implementation of wire expects write before endTransmission_wire->write(0);
#endifif (_wire->endTransmission() ==0) {
The text was updated successfully, but these errors were encountered:
BeldrothTheGold
changed the title
Unable to communicate with LIS3DH on MagTag via Arduino.
Unable to communicate with LIS3DH on MagTag via I2C.
Aug 12, 2021
Uh oh!
There was an error while loading. Please reload this page.
Arduino board: Adafruit MagTag 2.9"
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.15
arduino-esp32 2.0.0 RC-1 installed via the boards manager
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
Upload sketch, reboot and open Serial Monitor.
I believe the issue is being caused by the esp32 implementation of the TwoWire::endTransmission() function expecting the user to call Wire.write() prior to calling Wire.endTransmission()
uint8_t TwoWire::endTransmission(bool sendStop) // Assumes Wire.beginTransaction(), Wire.write()
https://github.com/espressif/arduino-esp32/blob/2af8cc34850c445b1b0694653f086b9f9b1f52f9/libraries/Wire/src/Wire.cpp#L171
Minimum Sketch to reproduce issue:
This seems like an OK workaround:
Adding the following lines to the detected() function in Adafruit_I2CDevice.cpp
The text was updated successfully, but these errors were encountered: