Kotlin/coroutines patterns for driving rate-limited IoT actuators from real-time producers: debounce controller, target quantization, bottom-up progress-bar rendering.
73
68%
Does it follow best practices?
Impact
95%
1.63xAverage score across 3 eval scenarios
Passed
No known issues
A developer built a Kotlin application that drives a 6-segment Govee LED volume meter based on live microphone input. The audio pipeline reads RMS amplitude from a microphone at ~30 fps and feeds it into a controller that should update the LED bar's brightness level in real time.
The application has been running in the lab for a week, but the LED bar barely ever changes — it occasionally flickers to a new level but mostly stays stuck. The developer added a println("Applied: $v") and confirmed it almost never prints, even though the audio is clearly changing. They've ruled out the audio capture and the HTTP transport; the problem is somewhere in how values are submitted to the controller or how the controller decides to apply them.
The starter code is in the starter/ directory. Review the implementation, identify all the bugs and design issues that explain why onApply is almost never called, and produce a corrected version.
Produce the following files in your working directory:
fixed/AudioMeter.kt — the corrected implementation with all issues resolvedfixed/build.gradle.kts — updated build file with any missing dependencies addeddiagnosis.md — a short document (bullet points are fine) listing each problem found in the original code and what you changed to fix itThe fixed version should: