pub fn add_phase(
            mut self,
            led_intensity: u8,
            fading_transition_duration: u16,
            led_duration: u16,
        ) -> Self {
            let led_intensity = {
                let saturated = if 100 < led_intensity {
                    100
                } else {
                    led_intensity
                } as f32;
                ((saturated / 6.25) as u8).into()
            };
            let fading_transition_duration: u4 = {
                let gmcd: u8 = self.global_mini_cycle_duration.into();
                (fading_transition_duration / gmcd as u16) as u8
            }
            .into();
            let led_duration = {
                let gmcd: u8 = self.global_mini_cycle_duration.into();
                (led_duration / gmcd as u16) as u8
            }
            .into();

            let phase = LightEmittingPhase {
                led_intensity,
                fading_transition_duration,
                led_duration,
            };

            self.push_phase(phase);

            self
        }
/// Add emitting phase to pattern.
///
/// `fading_transition_duration` and `led_duration` is represented by 4-bit unsigned int
/// in field and is treated as a multiplier of the `LightEmittingPattern.global_mini_cycle_duration`
/// specified by the first argument of LightEmittingPattern::new().
///
/// Therefore, depending on the combination of the `LightEmittingPattern.global_mini_cycle_duration`
/// and the specified value, different values may be regarded as the same value
/// when converted to 4-bit unsigned int, and no difference may appear in the luminous pattern.
///
/// * led_intensity (*%*) - 0 <= led_intensity <= 100
/// * fading_transition_duration (*ms*) - 0 < fading_transition_duration < self.global_mini_cycle_duration (ms) * 15
/// * led_duration (*ms*) - 0 < fading_transition_duration < self.global_mini_cycle_duration (ms) * 15
Add emitting phase to pattern.

Therefore, depending on the combination of the `LightEmittingPattern.global_mini_cycle_duration`
and the specified value, different values may be regarded as the same value
when converted to 4-bit unsigned int, and no difference may appear in the luminous pattern.


Add emitting phase to pattern . Therefore depending on the combination of the ` LightEmittingPattern . global_mini_cycle_duration ` and the specified value different values may be regarded as the same value when converted to 4 - bit unsigned int and no difference may appear in the luminous pattern .
pub fn add_phase(
            mut self,
            led_intensity: u8,
            fading_transition_duration: u16,
            led_duration: u16,
        ) -> Self {
            let led_intensity = {
                let saturated = if 100 < led_intensity {
                    100
                } else {
                    led_intensity
                } as f32;
                ((saturated / 6.25) as u8).into()
            };
            let fading_transition_duration: u4 = {
                let gmcd: u8 = self.global_mini_cycle_duration.into();
                (fading_transition_duration / gmcd as u16) as u8
            }
            .into();
            let led_duration = {
                let gmcd: u8 = self.global_mini_cycle_duration.into();
                (led_duration / gmcd as u16) as u8
            }
            .into();
            let phase = LightEmittingPhase {
                led_intensity,
                fading_transition_duration,
                led_duration,
            };
            self.push_phase(phase);
            self
        }
pub fn add_phase ( mut self , led_intensity : u8 , fading_transition_duration : u16 , led_duration : u16 , ) -> Self { let led_intensity = { let saturated = if 100 < led_intensity { 100 } else { led_intensity } as f32 ; ( ( saturated / 6.25 ) as u8 ) . into ( ) } ; let fading_transition_duration : u4 = { let gmcd : u8 = self . global_mini_cycle_duration . into ( ) ; ( fading_transition_duration / gmcd as u16 ) as u8 } . into ( ) ; let led_duration = { let gmcd : u8 = self . global_mini_cycle_duration . into ( ) ; ( led_duration / gmcd as u16 ) as u8 } . into ( ) ; let phase = LightEmittingPhase { led_intensity , fading_transition_duration , led_duration , } ; self . push_phase ( phase ) ; self }
Add emitting phase to pattern.
Add emitting phase to pattern .
mut self
led_intensity
u8
fading_transition_duration
u16
led_duration
u16
mut self
led_intensity
u8
fading_transition_duration
u16
led_duration
u16