From 80d5508b73d15693f1dd20dfc7bfb8462f611e44 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 20 Jun 2015 21:57:09 +0300 Subject: [PATCH] fix I2C case where using different pins would not work with libs calling begin internally if you call Wire.begin(new_sda, new_scl) and your library calls internally Wire.begin() this will overwrite the SDA,SCL pins to the default ones --- libraries/Wire/Wire.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp index 03901583c..759159203 100644 --- a/libraries/Wire/Wire.cpp +++ b/libraries/Wire/Wire.cpp @@ -55,6 +55,8 @@ TwoWire::TwoWire(){} // Public Methods ////////////////////////////////////////////////////////////// void TwoWire::begin(int sda, int scl){ + default_sda_pin = sda; + default_scl_pin = scl; twi_init(sda, scl); flush(); }