Class MonoFlop - GSTCH/SketchMadeEASY GitHub Wiki
Topic | Specification |
---|---|
Description | Defined duration depends on the value of the digital pin. The duration of high and low can be configured by LowDelay and HighDelay. There are different state values when pin change![]() Optional is a debounce time (duration to ignore any changes after LOW/HIGH or HIGH/LOW change). This classes support the SwitchResistoreMode, set in the constructor. Default is internal pullup. |
Constructor |
MonoFlop(int Pin, int HighDelay, int LowDelay, bool Start, ESwitchResistoreMode SwitchResistoreMode, int DebounceTimeMSec); Parameter Pin: Pin number HighDelay: Duration of timer when pin goes to high (switch opens) in Millseconds. Duration must be greather than the debounce time. LowDelay: Duration of timer when pin goes to low (switch closes) in Millseconds. Duration must be greather than the debounce time.Start: Start an interval at start of Arduino, depending of the pin value.SwitchResistoreMode: Optional with default smPullDownInternal (0). Details read Switch-Resistore-Mode. Possible values are:* smPullDownInternal (=0) * smPullDownExternal (=1) * smPullUpExternal (=2) Sketch Made Easy hides the different values of the pin and always has the same value DebounceTime: Optional with Default=50ms. The interval that must pass before a value changed is accepted. Value in Milliseconds. |
Range | StateLow(0)… StateHighTimerEnd(5) |
Const |
0: MonoFlop::StateLow1: MonoFlop::StateLowTimerRun2: MonoFlop::StateLowTimerEnd3: MonoFlop::StateHigh4: MonoFlop::StateHighTimerRun5: MonoFlop::StateHighTimerEnd |
Samples | MonoFlop monoFlop* = new MonoFlop(5, 500, 1000, false); MonoFlop monoFlop* = new MonoFlop(5, 500, 1000, false, smPullUpExternal); MonoFlop monoFlop* = new MonoFlop(5, 500, 1000, false, smPullDownExternal, 60); |
Examples | 11-Two motors, one turns after the other |