Skip to content

Commit

Permalink
Merge pull request #22 from JadKHaddad/fix/typos
Browse files Browse the repository at this point in the history
fix(typos): fixed typos in demo module
  • Loading branch information
JadKHaddad authored Sep 17, 2024
2 parents 23efe30 + ea58f11 commit 237985a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tm1637/src/demo/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ where
}

/// Turn the display on and off.
pub fn on_off(&mut self, cycles: u32, of_off_delay_ms: u32) -> Result<(), ERR> {
pub fn on_off(&mut self, cycles: u32, on_off_delay_ms: u32) -> Result<(), ERR> {
for _ in 0..cycles {
self.device.off()?;
self.delay.delay_ms(of_off_delay_ms);
self.delay.delay_ms(on_off_delay_ms);
self.device.on()?;
self.delay.delay_ms(of_off_delay_ms);
self.delay.delay_ms(on_off_delay_ms);
}

Ok(())
Expand All @@ -142,12 +142,12 @@ where

let mut show = true;
for _ in 0..cycles {
let bit = match show {
let byte = match show {
true => DigitBits::Nine as u8 | SegmentBits::SegPoint as u8,
false => DigitBits::Nine as u8,
};

self.device.write_segments_raw(1, &[bit])?;
self.device.write_segments_raw(1, &[byte])?;

self.delay.delay_ms(blink_delay_ms);

Expand Down

0 comments on commit 237985a

Please sign in to comment.