Skip to content

pdx-cs-rust-embedded/hw-rgbcal-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rgbcal: RGB LED calibration tool

Bart Massey 2024

This tool is designed to find out a decent frame rate and maximum RGB component values to produce a white-looking RGB of reasonable brightness.

See below for UI.

XXX This tool is mostly finished! Please wire your hardware up (see below), finish it, comment it, and use it to find good values. Then document those values in this README.

Build and Run

Run with cargo embed --release. You'll need cargo embed, as cargo run / probe-rs run does not reliably maintain a connection for printing. See probe-rs/probe-rs#1235 for the details.

Wiring

Connect the RGB LED to the MB2 as follows:

  • Red to P9 (GPIO1)
  • Green to P8 (GPIO2)
  • Blue to P16 (GPIO3)
  • Gnd to Gnd

Connect the potentiometer (knob) to the MB2 as follows:

  • Pin 1 to Gnd
  • Pin 2 to P2
  • Pin 3 to +3.3V

UI

The knob controls the individual settings: frame rate and color levels. Which parameter the knob controls should be determined by which buttons are held. (Right now, the knob jus always controls Blue. You should see the color change from green to teal-blue as you turn the knob clockwise.)

  • No buttons held: Change the frame rate in steps of 10 frames per second from 10..160.
  • A button held: Change the blue level from off to on over 16 steps.
  • B button held: Change the green level from off to on over 16 steps.
  • A+B buttons held: Change the red level from off to on over 16 steps.

The "frame rate" (also known as the "refresh rate") is the time to scan out all three colors. (See the scanout code.) At 30 frames per second, every 1/30th of a second the LED should scan out all three colors. If the frame rate is too low, the LED will appear to "blink". If it is too high, it will eat CPU for no reason.

I think the frame rate is probably set higher than it needs to be right now: it can be tuned lower.

About

solution to rgb calibration homework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published