What it is: The APDS9960 is the sensor from old smartphones that can detect proximity, ambient light, RGB colour, and hand gestures (swipe up/down/left/right). This tutorial uses its proximity mode, the easiest to get running.
How it works: I2C device at address 0x39. In proximity mode it returns a 0–255 value that rises as an object gets closer (roughly within 10 cm). Shares SDA/SCL with the OLED.
Wiring (shared I2C bus with the OLED):
APDS9960 SDA -> GPIO4
APDS9960 SCL -> GPIO5
APDS9960 VCC -> 3V3
APDS9960 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: "SparkFun APDS9960 RGB and Gesture Sensor", plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: a proximity value 0–255 and a bar. Move your hand toward and away from it.
Gotchas: Gesture mode needs the interrupt pin and more setup; proximity is the friendly starting point. Address 0x39 is fixed. It shares 0x39 with the TSL2561 default — don't put both on one bus.