launchy
launchy copied to clipboard
add very very basic support for launchpad1
i have a launchpad1 and wanted to create a simple program for my 1 year old daughter. Just a few buttons that are clickable.
using trial and error i managed to do basic stuff like clear, button_set, ....
the code is not mergeable and contains a lot of stuff from the mk2 (didn't try the canvas api, the color palette is wrong and so on ....) but may it's interesting for someone who also want to add support for launchpad1.
i also doesn't found any good docs about the launchpad1 - if someone knows where to find them, pls let me know. :)
example code that works:
let input = launchy::launchpad_orig::Input::guess_polling()?;
let mut output = launchy::launchpad_orig::Output::guess()?;
output.clear()?;
for msg in input.iter() {
match msg {
Message::Press {button} => {
output.set_button(button, PaletteColor::new(3), LightMode::Flash)?;
},
Message::Release {button} => {
output.set_button(button, PaletteColor::new(48), LightMode::Flash)?;
},
_ => {}
}
println!("data {:?}", msg);
}
Thanks for the PR! I will not merge the PR, but probably keep it open for others to see...
By the way, a better base to build upon would probably be the Launchpad S (instead of MK2). The S is both chronologically and API-wise very near to the original Launchpad.