B:BD[
3.1694] → [
3.1694:2067]
// for (0..20) |i| {
// inline for (&.{ "28", "27", "26", "22", "21", "20", "19", "18", "17", "16" }, 0..) |io, counter| {
// const val = map(isize, duties[i + counter], 0, 1024, LOW, HIGH);
// _ = @field(pins, "GPIO" ++ io).set_level(@intCast(val));
// }
// time.sleep_ms(SLEEP_MS);
// }
for (0..20) |i| {
inline for (&.{ "15", "14", "13", "12", "11", "10", "9", "8", "7", "6" }, 0..) |io, counter| {
const val = map(isize, duties[i + counter], 0, 1024, LOW, HIGH);
_ = @field(pins, "GPIO" ++ io).set_level(@intCast(val));
}
const sample = pico.adc.convert_one_shot_blocking(.ain0) catch unreachable;
pico.time.sleep_ms(@min(500, sample));
}