Skip to content

Quiz: Programming the Pi 500+'s Per-Key RGB Keyboard Lighting

Test your understanding of programming the Pi 500+'s per-key RGB keyboard lighting with these review questions.


1. What is a key scan code?

  1. A saved LED configuration stored in a numbered slot on the keyboard
  2. A single key programmed to send a sequence of keystrokes
  3. A named group of keys that a lighting effect targets together
  4. A numeric identifier for a specific physical key position, independent of the printed character on its keycap
Show Answer

The correct answer is D. A key scan code is a numeric identifier for a specific physical key position, independent of what letter or symbol is printed on its keycap, reported by the firmware when a matrix intersection is triggered. Option A describes a lighting preset, option B describes a macro key, and option C describes an RGB LED zone.

Concept Tested: Key Scan Code


2. What is a keyboard API?

  1. The software built into the keyboard's own controller chip that scans for key presses
  2. A standardized way of describing input events over a USB connection
  3. The set of functions a program is allowed to call to control the keyboard's behavior, without needing to know how requests are transmitted over USB HID
  4. A grid of rows and columns where each key sits at one intersection
Show Answer

The correct answer is C. A keyboard API is the set of functions a program is allowed to call to control the keyboard's behavior — reading its state, setting LED colors, changing presets — without needing to know how those requests are actually transmitted over USB HID underneath. Option A describes keyboard firmware, option B describes the USB HID protocol, and option D describes a keyboard matrix.

Concept Tested: Keyboard API


3. How does ambient lighting mode differ from reactive lighting, according to the chapter's comparison?

  1. Ambient lighting runs continuously on a timer regardless of typing, while reactive lighting changes only when a relevant key event occurs
  2. Ambient lighting changes only when a key press or release event occurs, while reactive lighting runs continuously regardless of typing
  3. Ambient lighting and reactive lighting are two names for the same lighting behavior
  4. Ambient lighting can only use a single color, while reactive lighting can use a full gradient
Show Answer

The correct answer is A. The chapter's comparison table shows ambient lighting mode triggered by a continuous timer/loop, changing constantly regardless of typing, while reactive lighting is triggered by a key press or release event and changes only when that event occurs. Option B reverses these two behaviors. Option C incorrectly treats them as identical, and option D invents a color restriction the chapter does not describe.

Concept Tested: Ambient Lighting Mode


4. How does a macro key differ from an ordinary keyboard shortcut?

  1. A macro key only works with RGB lighting effects, while a keyboard shortcut only works with text editors
  2. A macro key is a single key programmed to send an entire sequence of keystrokes or trigger a multi-step action when pressed once, while a keyboard shortcut is a combination of keys pressed together that triggers one specific action
  3. A macro key and a keyboard shortcut are exactly the same feature, differing only in name
  4. A macro key requires custom key mapping, while a keyboard shortcut cannot be reprogrammed
Show Answer

The correct answer is B. A macro key is a single key programmed to send an entire sequence of keystrokes or trigger a multi-step action when pressed once, while a keyboard shortcut is a combination of keys pressed together (like Ctrl+C) that triggers one specific software action. Option A invents restrictions the chapter does not describe. Option C incorrectly treats them as identical, and option D invents a dependency that isn't stated.

Concept Tested: Macro Key


5. Why does the chapter recommend an accessibility lighting cue for certain classroom situations?

  1. It reduces the total number of colors a lighting effect can use
  2. It automatically increases keyboard backlight brightness to maximum
  3. It replaces the need for a keyboard API entirely
  4. It communicates information that might otherwise rely on sound alone, useful for a student who is deaf or hard of hearing or working in a noisy room
Show Answer

The correct answer is D. An accessibility lighting cue uses a deliberately chosen, high-contrast color and timing pattern to communicate information that might otherwise rely on sound alone — useful for a student who is deaf or hard of hearing, or working in a noisy classroom where an audio alert would be missed. Options A, B, and C each describe unrelated or incorrect mechanisms not tied to the chapter's accessibility discussion.

Concept Tested: Accessibility Lighting Cue


6. A teacher wants the classroom's shared robot to silently flash a distinct color on the Pi 500+ keyboard three times whenever its battery gets low, without requiring anyone to be actively typing. Which lighting concept from this chapter best fits this need?

  1. A notification lighting pattern
  2. Ambient lighting mode
  3. A macro key
  4. Custom key mapping
Show Answer

The correct answer is A. A notification lighting pattern flashes the keyboard (or a specific set of keys) a distinct color a fixed number of times when a chosen event occurs, such as a battery running low, exactly matching this scenario, and the chapter's own flash_keyboard() example demonstrates this pattern directly. Ambient lighting (option B) runs continuously regardless of events, and a macro key (option C) or custom key mapping (option D) address typing behavior, not status alerts.

Concept Tested: Notification Lighting Pattern


7. In the chapter's rainbow_wave() function, hue is computed as (led.x * 3 + int(time.time() * 50)) % 256. If a student changes the multiplier on led.x from 3 to a much larger number, what visible effect would this most likely produce?

  1. The animation would stop moving entirely
  2. Every key would instantly turn the same color
  3. More distinct hues would appear packed across the keyboard at any single moment, since each key's x-position would have a larger effect on its hue
  4. The keyboard backlight brightness would increase
Show Answer

The correct answer is C. Since hue depends on led.x * factor, increasing that multiplier makes each key's horizontal position contribute a larger swing in hue, packing more distinct colors across the same physical row of keys at any given moment — exactly what the chapter's own animation MicroSim describes as "Gradient Spread." Option A is wrong since the time-based term is unaffected. Option B would require removing the x-dependence entirely, and option D confuses hue with an unrelated brightness setting.

Concept Tested: Color Gradient Effect


8. A student wants a lighting effect that plays continuously in the background while they work, unrelated to what they are actively typing, purely to look visually interesting. Which category of lighting effect from this chapter fits this goal?

  1. Reactive lighting
  2. Event-driven lighting
  3. A key release event
  4. Ambient lighting mode
Show Answer

The correct answer is D. Ambient lighting mode is lighting meant to run as background atmosphere rather than to communicate a specific, timely piece of information — running continuously regardless of what the user is doing, exactly matching this goal. Reactive lighting (option A) and event-driven lighting (option B) both depend on typing activity to trigger changes, and a key release event (option C) is a single discrete occurrence, not a continuous effect.

Concept Tested: Ambient Lighting Mode


9. A student's script calls set_led_by_matrix() for several keys, but the keyboard's actual LEDs never change color. The script runs without any errors. What is the most likely cause?

  1. The keyboard firmware has crashed
  2. The script never called send_leds(), so the queued color changes were never pushed to the physical keys
  3. The keys targeted don't exist in the keyboard matrix
  4. The USB HID protocol only supports reading, not writing, key states
Show Answer

The correct answer is B. The chapter explicitly states that queued colors set with set_led_by_matrix() don't take effect until send_leds() is called, which pushes every queued change to the keyboard at once — a script that skips this call will run without errors but produce no visible LED change. Option A and D describe more severe failures that would typically raise an error, and option C would likely still raise an error rather than silently succeed.

Concept Tested: Python Keyboard Library


10. A student designs a fast, high-contrast notification lighting pattern for a shared classroom keyboard, and another student reports it is uncomfortable to look at. Based on this chapter's guidance, what design change addresses this issue?

  1. Increase the flash frequency further so it is too fast to perceive
  2. Switch from a notification lighting pattern to per-key RGB lighting entirely
  3. Keep flashes slow and infrequent, and consider a gentler pulse instead of a hard flash as the default
  4. Remove all color from the effect and use only keyboard backlight brightness changes
Show Answer

The correct answer is C. The chapter's explicit warning states that rapid, high-contrast flashing can be genuinely uncomfortable, or worse, for people with photosensitive conditions, and recommends keeping flashes slow and few, considering a gentler pulse instead of a hard flash as the default. Option A would worsen the problem. Option B misapplies an unrelated concept, since per-key RGB lighting is the underlying hardware capability, not a design fix, and option D is an overcorrection not suggested by the chapter.

Concept Tested: Visual Feedback Design