Skip to content

Problem with I2C Scan code #145

@thierry7100

Description

@thierry7100

Hi,

I have opened this issue back in April 2018, but there is still some problems

  1. Within LCD I2C, the code is still incorrect, there are simple quotes instead of double quotes
    Serial.println('I2C scanner. Scanning ...');
    byte count = 0;

Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ('Found address: ');
Serial.print (i, DEC);
Serial.print (' (0x');
Serial.print (i, HEX);
Serial.println (')');
count++;
delay (1);
} // end of good response
} // end of for loop
Serial.println ('Done.');
Serial.print ('Found ');
Serial.print (count, DEC);
Serial.println (' device(s).');

When using I2C block, the problem exists but some strings are enclosed between double quotes (correct) and some are enclosed between double quotes.

Serial.println('I2C scanner. Scanning ...');
byte count = 0;

Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ("Found address: ");
Serial.print (i, DEC);
Serial.print (" (0x");
Serial.print (i, HEX);
Serial.println (")");
count++;
delay (1);
} // end of good response
} // end of for loop
Serial.println ('Done.');
Serial.print ('Found ');
Serial.print (count, DEC);
Serial.println (' device(s).');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions