fn classify_button(pressed: bool) -> &'static str {
    if pressed {
        "pressed"
    } else {
        "released"
    }
}

fn classify_adc(raw: u16) -> &'static str {
    const LOW_MAX: u16 = 1365;
    const MID_MAX: u16 = 2730;

    match raw {
        0..=LOW_MAX => "low",
        (LOW_MAX + 1)..=MID_MAX => "medium",
        _ => "high",
    }
}

fn main() {
    let button_samples = [false, true, true, false];
    let adc_samples: [u16; 5] = [120, 900, 1500, 2600, 3900];

    for pressed in button_samples {
        println!("button: {}", classify_button(pressed));
    }

    for raw in adc_samples {
        println!("adc raw={raw:4} => {}", classify_adc(raw));
    }
}
