- What is Conditional Logic?
- Conditional logic means making decisions based on specific conditions.
- It uses if-then rules:
- If a condition is true ā take an action.
- If the condition is false ā do something else or do nothing.
- Why is Logic Important in Automation?
- Without logic, machines would just keep running blindly.
- Logic lets machines respond to their surroundings.
- Example:
- A streetlight turns ON at night (if dark ā turn on light).
- A fan starts when temperature is high (if hot ā start fan).
- How Logic Works in Microcontrollers
- Inputs: Signals from sensors (light, motion, temperature).
- Decision: The microcontroller checks the sensor values against set conditions.
- Outputs: Turns ON/OFF devices like LEDs, buzzers, or motors.
- Examples of Real-Life Logic in Devices
- Motion-activated lights (if motion detected ā turn light on).
- Washing machines (if water full ā stop filling, start washing).
- Automatic doors (if person detected ā open door).