Ported the Knob example from the official libraries. The hid::Led struct is roughly based on hid_led.cpp with some minor differences. Used this article as reference and so I've renamed samplerate which they use in hid_led.cpp to resolution, which I find is more intuitive. I'm also not sure why they divide 120 on this line hid_led.cpp#L41, so I didn't replicate it.
Pulling in the micromath crate is purely to get the f32.sqrt() function.
Ported the Knob example from the official libraries. The
hid::Led
struct is roughly based on hid_led.cpp with some minor differences. Used this article as reference and so I've renamedsamplerate
which they use inhid_led.cpp
toresolution
, which I find is more intuitive. I'm also not sure why they divide 120 on this line hid_led.cpp#L41, so I didn't replicate it.Pulling in the
micromath
crate is purely to get thef32.sqrt()
function.