I2C Scanner stuck on scanning

Good afternoon

When trying to connect my LCD to my Arduino MEGA2560 I upload the code of the I2C scanner but its stuck on scanning. The LCD is connected to SDA20 and SCL20, GND and VCC are connected to GND and 5V. It is a standard LCD 16x2 connected to an arduino mega2560. What could i have done wrong? Do i need pull up resistors? I tried using other SCL,SDA ports, different USB ports and a different PC.


the uno and mega use different pins. see Arduino - Wire

OP is using the right pins for a Mega (but surely meant SCL21 not SCL20). The I2C pins are duplicated next to the AREF and GND pins in the same position on both an Uno and a Mega if they are R3's.

The following figure depicts that the MEGA has built-in 2x10k pull-ups on the I2C Bus and at the same time the IO Board of the LCD Panel also has built-in 2x10 pull-ups. As a result, the effective pull-ups on the I2C Bus are: 2x5k.

Note: Some LCDs are seen at address 0x27 and some are seen at 0x3F; try both.

byte busStatus = Wire.endTransmission();
if(busStatus !=0)
    Serial.print("LCD is not found...!");
    while(1);    //wait for ever;
Serial.print("LCD has been found.")