-
Notifications
You must be signed in to change notification settings - Fork 0
Class LoopSwitch
Hans Rothenbuehler edited this page Mar 29, 2024
·
6 revisions
| Topic | Specification |
|---|---|
| Description | A shift register control by a a signal (e.g. button): The value iterate through a defined range (MIN...MAX). When pin goes to high the value increases by step width. When pin is low the value is low as well. Optional is a debounce time (duration to ignore any changes after LOW/HIGH or HIGH/LOW change). This classes support the Switch-Resistore-Mode, set in the constructor. Default is internal pullup. |
| Constructor |
LoopSwitch(int Pin, int MinValue, int MaxValue, int StepWidth, ESwitchResistoreMode SwitchResistoreMode, int DebounceTimeMSec) Parameter Pin: Pin numberMinValue: Lowest value, start of incrementMaxValue: Highest value. If the value exceeds this limit, the logic sets it to MinValue.StepWidth: The value of the class is increased by this number each time the pin is changed to high.SwitchResistoreMode: Optional with default smPullDownInternal (0). Details read Switch-Resistore-Mode. Possible values are: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 | MinValue…MaxValue |
| Samples | LoopSwitch* switch = new LoopSwitch(4, 6, 1, 10, 1); LoopSwitch* switch = new LoopSwitch(4, 6, 2, 10, 2, smPullDownExternal); LoopSwitch* switch = new LoopSwitch(4, 6, 1, 10, 3, smPullUpExternal, 60); |
| Examples | Test 14 |
Wiki
Getting started
Classes
Input
- Calculate
- ConditionInput
- DependentInput
- DigitalInput
- FixValue
- Inverter
- IteratorValue
- JoystickAxis
- LoopSwitch
- MonoFlop
- Switch2Position
- Switch3Position
- Timer
- ToggleSwitch
- UltrasonicRangefinder
- VariableInput
Actuator
- ActuatorCollection
- Buzzer
- DigitalOutput
- EncoderMotorI2C
- EncoderMotorL298
- EncoderMotorL9110
- MotorI2C
- MotorL298
- MotorL9110
- MotorStepperRotate
- MotorStepperRotateI2C
- Servo360I2C
- Servo360PWM
- Servo360T1
- Servo360T2
- ServoPWM
- ServoStepperPosition
- ServoStepperPositionI2C
- ServoI2C
- ServoT1
- ServoT2
- VariableOutput
Condition
Relation
RemoteControl
Common
Sketches
Templates
Examples
- 01-Switch and Lamp
- 02-Dimming LED
- 03-Dimming LED with Switch
- 04-Blinking LED
- 05‐Motor fix speed, direction‐switch
- 06‐Motor variable speed, direction‐switch
- 07‐Motor variable speed, direction‐ and main‐switch
- 08‐Motor toggles between limit switches
- 09‐Motor toggles between limit switches, main switch
- 10‐Main Motor turns between limit switches, second follows
- 11-Two motors, one turns after the other
- 12-Servo360 controlled by a Joystick
- 13-Stepper motor with variable speed
- 14-RemoteControl of a motor with FlySky FS-i6X
- 15-RemoteControl of a motor with an App
- 16-EncoderMotor and LED controlled by FlySky-RemoteControl
- 17-Servo position in relation to a potentiometer
- 18-Stepper angle controlled by joystick
- 19-Buzzer tone in relation to distance
- 20-Dependent input
- 21-Alternate blink