Skip to content

feat(apds9960): Add color lamp example with OLED display. #331

@nedseb

Description

@nedseb

Description

Add a color_lamp.py example that detects the color of an object placed near the APDS9960 RGBC sensor and displays the detected color name and RGB values on the SSD1327 OLED in greyscale.

Difficulty

Level 2 — Intermediate (2-3 sessions)

What to do

Create lib/apds9960/examples/color_lamp.py that:

  1. Initializes the APDS9960 sensor (color/light mode)
  2. Initializes the SSD1327 OLED display over SPI
  3. Reads RGBC values from the sensor
  4. Determines the dominant color channel (R, G, or B)
  5. Displays the color name in large text on the OLED
  6. Shows the raw R, G, B values below
  7. Fills the screen background with a greyscale intensity matching overall brightness

Reference code

  • APDS9960 light/color: lib/apds9960/examples/ambient_light.py
  • SSD1327 text + rects: lib/ssd1327/examples/framebuf_text.py, framebuf_rects.py

Hardware required

  • STeaMi board (Rev A or later)
  • Colored objects (paper, LEGO bricks, etc.)

Conventions

See CONTRIBUTING.md for coding conventions and workflow.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions