The I2C scanner is a simple programs that scans the I2C user bus for connected devices. If a device is found the address is printed on the USB port. The program scans all addresses from 1 to 126/0x7E in a continuous loop separated by a 5 s delay.
Before you upload the program please make sure you have connected two resistor, 2 kΩ to 10 kΩ, from 3V3 to each of the D8 (SDA) and D9 (SCL) pins. If this fails try to upload the program again, while being prepared to double click the reset button, until the uploading is successful.
The output on the serial monitor while scanning.
Here is a list of the typical devices and their I2C addresses.