What it is: The TCS34725 reads the colour of a surface as red, green, blue and clear (brightness) values, with an onboard white LED to illuminate the target. Great for colour-sorting robots and mood lamps.
How it works: I2C device at address 0x29. It returns 16-bit raw R/G/B/C counts; this sketch scales them to the familiar 0–255 range using the clear channel. Shares SDA/SCL with the OLED.
Wiring (shared I2C bus with the OLED):
TCS34725 SDA -> GPIO4
TCS34725 SCL -> GPIO5
TCS34725 VIN -> 3V3
TCS34725 GND -> GND
(optional) LED pin -> GND to force the white LED off, or leave open for on
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: "Adafruit TCS34725" (installs "Adafruit BusIO"), plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: R, G and B values 0–255. Hold coloured paper about 1 cm away and watch the channels change.
Gotchas: Hold the target close and steady; ambient light throws readings off, which is why the onboard LED helps. Address 0x29 is fixed.