-
Notifications
You must be signed in to change notification settings - Fork 205
add possibility to pass in a Wire instance #49
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
Conversation
This adds the possibility to pass in a Wire instance to be able to configure the clock speed / frequency and also the used IO pins.
looks good! what hardware did you test with? |
Thanks! I tested with an ESP32 Dev Kit from AZ-Delivery and an MCP23017 Expansion Board from Waveshare |
do you have an AVR board like UNO to check with? |
I have to look into my box, but I might have none. |
ok please do :) that will help a lot! |
perfect :) |
Ok, I tested it using an Arduino Uno and set the clock speed to 400khz. Here's my test code: #include <Wire.h>
#include "Adafruit_MCP23017.h"
Adafruit_MCP23017 mcp;
void setup() {
Wire.setClock(400000); // set frequency to 400khz
mcp.begin(7, &Wire);
mcp.pinMode(5, OUTPUT);
mcp.digitalWrite(5, HIGH);
}
void loop() {
delay(5000);
mcp.digitalWrite(5, LOW);
delay(5000);
mcp.digitalWrite(5, HIGH);
} And here's a video showing the test: Sadly I have no oscilloscope, so I could not validate if it runs @ 400khz. |
sounds good, thanks! |
Thanks a lot! |
This adds the possibility to pass in a Wire instance to be able to configure the clock speed / frequency and also the used IO pins.