Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions kidbright_i2c2/kidbright_i2c2.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <Wire.h>
TwoWire Wire2 = TwoWire(1);
byte error, address;
byte err, address;
int nDevices;

void setup()
Expand All @@ -20,9 +20,9 @@ void loop()
for(address = 1; address < 127; address++ )
{
Wire.beginTransmission(address);
error = Wire.endTransmission();
err = Wire.endTransmission();

if (error == 0)
if (err == 0)
{
Serial.print("Wire: I2C device found at address 0x");
if (address<16)
Expand All @@ -32,7 +32,7 @@ void loop()

nDevices++;
}
else if (error==4)
else if (err==4)
{
Serial.print("Wire: Unknown error at address 0x");
if (address<16)
Expand All @@ -49,9 +49,9 @@ void loop()
for(address = 1; address < 127; address++ )
{
Wire2.beginTransmission(address);
error = Wire2.endTransmission();
err = Wire2.endTransmission();

if (error == 0)
if (err == 0)
{
Serial.print("Wire2: I2C device found at address 0x");
if (address<16)
Expand All @@ -61,7 +61,7 @@ void loop()

nDevices++;
}
else if (error==4)
else if (err==4)
{
Serial.print("Wire2: Unknown error at address 0x");
if (address<16)
Expand Down