pub struct CustomTrigger { /* private fields */ }
Expand description
Trigger signal detector with custom range.
Whenever you need to detect a trigger with a custom threshold.
Implementations§
Source§impl CustomTrigger
impl CustomTrigger
pub fn set_threshold(&mut self, low_thres: f32, high_thres: f32)
Sourcepub fn check_trigger(&mut self, input: f32) -> bool
pub fn check_trigger(&mut self, input: f32) -> bool
Checks the input signal for a trigger and returns true when the signal surpassed the high threshold and has not fallen below low threshold yet.
Trait Implementations§
Source§impl Clone for CustomTrigger
impl Clone for CustomTrigger
Source§fn clone(&self) -> CustomTrigger
fn clone(&self) -> CustomTrigger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CustomTrigger
impl Debug for CustomTrigger
impl Copy for CustomTrigger
Auto Trait Implementations§
impl Freeze for CustomTrigger
impl RefUnwindSafe for CustomTrigger
impl Send for CustomTrigger
impl Sync for CustomTrigger
impl Unpin for CustomTrigger
impl UnwindSafe for CustomTrigger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more