Blockly-at-rduino icon indicating copy to clipboard operation
Blockly-at-rduino copied to clipboard

Problem with I2C Scan code

Open thierry7100 opened this issue 6 years ago • 1 comments

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).');

thierry7100 avatar Jan 16 '19 11:01 thierry7100

In which category is this code ? Which LCD screen ? Could you explain "strings are enclosed between double quotes (correct) and some are enclosed between double quotes" Thanks.

SebCanet avatar Jan 16 '19 23:01 SebCanet