Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions boards/itsybitsy_m0/examples/dotstar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,9 @@ fn main() -> ! {

let mut rgb = pins.dotstar.init(SpinTimer::new(12), &mut pins.port);

let mut val = 0;
let mut val: u8 = 0;
loop {
// Can't use the modulo operator on a u8 with an overflowing u8 or with a u16
val = match val {
255 => 0,
_ => val + 1,
};
val = val.wrapping_add(1);
let color: [RGB8; 1] = [rgb_wheel(val)];
rgb.write(color.iter().cloned()).unwrap();
delay.delay_ms(60u8);
Expand Down
8 changes: 2 additions & 6 deletions boards/trinket_m0/examples/dotstar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@ fn main() -> ! {
let mut delay = Delay::new(core.SYST, &mut clocks);
let mut rgb = pins.dotstar.init(SpinTimer::new(12), &mut pins.port);

let mut val = 0;
let mut val: u8 = 0;
loop {
// Can't use the modulo operator on a u8 with an overflowing u8 or with a u16
val = match val {
255 => 0,
_ => val + 1,
};
val = val.wrapping_add(1);
let color: [RGB8; 1] = [rgb_wheel(val)];
rgb.write(color.iter().cloned()).unwrap();
delay.delay_ms(60u8);
Expand Down