Class LogicCondition - GSTCH/SketchMadeEASY GitHub Wiki

LogicCondition

Topic Specification
Description Sketch Made EASY combines inputs with actuators through logic. The logic is defined by the conditions. If a condition is true, the relation to the actuator is active. This condition combines two (compare) conditions with a logic operator.
Constructor LogicCondition(Input* Input1, ECompareOperator CompareOperator1, int CompareParameter1, ELogicOperator LogicOperator, Input* Input2, CompareOperator CompareOperator2, int CompareParameter2)
LogicCondition(Condition* Condition1, ELogicOperator LogicOperator, Condition* Condition2)
Parameter
Input: Any input whose value should be compared.
CompareOperator: Operator
* OpEQ (1): Equals =
* OpGT (2): Greater than >
* OpLT (3): Less than <
* OpNEQ (4): Not equal to !=
* OpGTE (5): greater than or equal to >=
* OpLTE (6): less than or equal to <=
CompareParameter: Value to compare with
LogicOperator: Operator compares the two conditions
* LgAND (1)
* LgOR (2)
* LgANDNOT (3)
Condition: Any condition
Samples LogicCondition* motorForwardCondition = new LogicCondition(mainSwitch, OpEQ, Switch2Position::On, LgAND, motorSwitch, OpEQ, Switch3Position::Pos1);
LogicCondition* motorBackwardCondition = new LogicCondition(mainSwitch, OpEQ, Switch2Position::On, LgAND, motorSwitch, OpEQ, Switch3Position::Pos2);
Examples 07‐Motor variable speed, direction‐ and main‐switch
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
⚠️ **GitHub.com Fallback** ⚠️