-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arduino Mega2560 compatibility #1
Comments
The call to setClockStretchLimit should only be required for ESP8266 and ESP32 devices and is part of the Arduino ESP8266 Wire library. In CCS811.cpp there is a pre-compiler ifdef statement which should only call it for ESP8266 devices and in the example, you should just be able to remove the Wire.setClockStretchLimit(500); line. |
it doesn't seem to read values on an arduino mega |
this is what I get on an Arduino without clock strechting, the same with esp8266(Wemos D1 Mini) |
An error code of 24 (decimal)/0x18 (hex) is reporting: Both of those things seem unlikely. What CCS811 breakout are you using? Some things to check, make sure there are pull ups to 3.3v (for the Wemos D1) on the SDA and SCL signals somewhere. The Wemos D1 and NodeMCU do not have them on their boards (on the standard pins) so the pull ups either need to be on the CCS811 breakout (like in the case of the Adafruit breakout) or in between the board and sensor. As for clock stretching, it is a function of the slave device and not something the master has to enable, the master either supports it or it doesn't. The ESP8266 devices support it and the call to setClockStretchLimit is just increasing an existing timeout. The default value is too short for the CCS811. Another thing to try is add an output which asserts then negates the active low reset of the CCS811 in the setup() function before setting it up. When I started using the CCS811 I had a lot of issues that were caused by resetting the ESP8266 and not asserting the CCS811 reset before trying to reconfigure it. It appeared the CCS811 wasn't behaving well when the ESP8266 was reset in the middle of an operation which then caused the sensor to not respond or behave poorly. I will try to find some time to retest with a Wemos D1 and the latest version of the ESP8266 Arduino library and see if anything changed. I have had the Adafruit CCS811 sensor running with a Wemos D1 for a long time with no issues. Though it was not the easiest device to deal with. |
I use a cjmcu-8128 board, will check for pull ups, thank you for you knowledge |
Hello, the
command doesn't work on an Arduino Mega2560. It just isn't defined in the Wire library probably?
The text was updated successfully, but these errors were encountered: