-
Notifications
You must be signed in to change notification settings - Fork 0
Class Switch3Position
Hans Rothenbuehler edited this page Mar 29, 2024
·
11 revisions
| Topic | Specification |
|---|---|
| Description | Switch with three position (e.g. Forward/Off/Backward-Switch). Use two diginal input pin, set in the constructor. 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. For switch with 2 position (e.g. On/Off) see class Switch2Positon |
| Constructor |
Switch3Position (int Position1Pin, int Position2Pin, ESwitchResistoreMode SwitchResistoreMode, int DebounceTime) Parameter Position1Pin: Pin number of position 1Position2Pin: Pin number of position 2SwitchResistoreMode: 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 | 0 (Pos0), 1 (Pos1), 2 (Pos2) |
| Const |
0: Switch3Position::Pos0, Switch3Position::Off, Switch3Position::Mid1: Switch3Position::Pos12: Switch3Position::Pos2 |
| Samples | Switch3Position* switch = new Switch3Position(4, 6); Switch3Position* switch = new Switch3Position(4, 6, smPullDownExternal); Switch3Position* switch = new Switch3Position(4, 6, smPullUpExternal, 60); |
| Examples |
05‐Motor fix speed, direction‐switch 06‐Motor variable speed, direction‐switch 07‐Motor variable speed, direction‐ and main‐switch 13-Stepper motor with variable speed 20-Dependent input |
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