Skip to content

Commit 30e6e86

Browse files
Fixed I2C bus speed issue
Was initializing the I2C bus speed incorrectly, accidentally configuring Arduino as a slave at address 10000 instead of running I2C at 100kHz. Gotta go fast.
1 parent 09fe262 commit 30e6e86

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

examples/Example1_BasicReadings/Example1_BasicReadings.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ MCP9600 tempSensor;
1818

1919
void setup(){
2020
Serial.begin(115200);
21-
Wire.begin(10000);
21+
Wire.begin();
22+
Wire.setClock(100000);
2223

2324
//check if the sensor is connected
2425
if(tempSensor.isConnected()){

examples/Example2_SetThermocoupleType/Example2_SetThermocoupleType.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Thermocouple_Type type = TYPE_S; //the type of thermocouple to change to!
2323

2424
void setup(){
2525
Serial.begin(115200);
26-
Wire.begin(10000);
26+
Wire.begin();
27+
Wire.setClock(100000);
2728

2829
//check that the sensor is connected
2930
if(tempSensor.isConnected()){

examples/Example3_SetFilterCoeffecients/Example3_SetFilterCoeffecients.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ uint8_t coeffecient = 3;
2323

2424
void setup(){
2525
Serial.begin(115200);
26-
Wire.begin(10000);
26+
Wire.begin();
27+
Wire.setClock(100000);
2728

2829
//check if the sensor is connected
2930
if(tempSensor.isConnected()){
@@ -36,7 +37,7 @@ void setup(){
3637

3738
//check if the Device ID is correct
3839
if(tempSensor.checkDeviceID()){
39-
Serial.println("Device ID is correct!");
40+
Serial.println("Device ID is correct!");
4041
}
4142
else {
4243
Serial.println("Device ID is not correct! Freezing.");

examples/Example4_SetResolution/Example4_SetResolution.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Thermocouple_Resolution thermocoupleRes = RES_14_BIT;
4848

4949
void setup(){
5050
Serial.begin(115200);
51-
Wire.begin(10000);
51+
Wire.begin();
52+
Wire.setClock(100000);
5253
//check if the sensor is connected
5354
if(tempSensor.isConnected()){
5455
Serial.println("Device will acknowledge!");

examples/Example5_BurstMode/Example5_BurstMode.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Burst_Sample samples = SAMPLES_8;
2424

2525
void setup(){
2626
Serial.begin(115200);
27-
Wire.begin(10000);
27+
Wire.begin();
28+
Wire.setClock(100000);
2829

2930
//check if the sensor is connected
3031
if(tempSensor.isConnected()){

examples/Example6_ConfigureTemperatureAlert/Example6_ConfigureTemperatureAlert.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ uint8_t hysteresis = 2; //How much hysteresis to have, in degrees Celcius. Feel
3333

3434
void setup(){
3535
Serial.begin(115200);
36-
Wire.begin(10000);
36+
Wire.begin();
37+
Wire.setClock(100000);
3738

3839
//check if the sensor is connected
3940
if(tempSensor.isConnected()){

0 commit comments

Comments
 (0)