Events Are Everywhere Now that you know what an event is — something that happens that a programme notices and responds to — let us look around. Events are not just in computers and phones. They are in everything around you. Once you learn to spot them, you will never stop seeing them. In Your Home The Smoke Alarm A smoke alarm sits on the ceiling, doing nothing — until a certain amount of smoke particles enter the air. --- --- Event Smoke particles exceed safe level Trigger Smoke sensor detects particles in the air Response Alarm sounds loudly The smoke alarm is always watching. It never stops watching. Until the event occurs, it does nothing visible at all — but the moment smoke appears, it responds immediately. The Refrigerator Temperature Sensor Your fridge keeps food cold without you thinking about it. Inside, a temperature sensor monitors the temperature constantly. --- --- Event Temperature rises above target (e.g. 4°C) Trigger The temperature sensor reading goes too high Response The compressor switches on to cool things down When it is cold enough again, another event fires: temperature is back at target → compressor switches off. In Your City Automatic Doors You walk towards the entrance of a supermarket. The doors slide open before you even reach them. --- --- Event Motion detected within a certain distance Trigger Motion or pressure sensor detects a person approaching Response Door motor activates, doors slide open When you walk away, another event: no motion detected for 3 seconds → doors slide closed. Traffic Lights at Night Some traffic lights behave differently at night. Instead of cycling red → yellow → green endlessly, they switch to a simple blinking yellow (caution mode). --- --- Event Clock reaches 23:59 (midnight) Trigger A timer inside the traffic signal system Response Switch from full cycling mode to blinking yellow mode At 06:00, another event fires and the full cycle resumes. No one presses a button — the event is time itself. In Your Devices Phone Notifications Your phone is in your pocket, screen off. Suddenly it vibrates. A message arrived. --- --- Event New message received Trigger The phone's messaging system detected incoming data Response Screen lights up, phone vibrates, notification sound plays You did not do anything. The event came from outside — from your friend sending a message — and the phone responded. Low Battery Warning --- --- Event Battery level drops to 20% Trigger Battery sensor reading hits the threshold Response Warning notification appears on screen Events Can Chain Together Here is something interesting: one event's response can itself cause another event. Smoke alarm example, extended: 1. Event: Smoke detected → Response: Alarm sounds 2. Event: Alarm sounds → Response: Smart home system sends a notification to your phone 3. Event: You receive the notification → Response: You open the app and check the camera The first event triggered the second, which triggered the third. Events chaining into each other is how complex systems work — each response can be a new trigger. The Pattern of Every Event By now you can see that every event follows the same structure: Trigger (what causes the event) → Event (the thing that happens) → Response (what the programme does) Device Trigger Event Response --- --- --- --- Doorbell Button pressed Electrical circuit closes Bell rings Smoke alarm Smoke detected Sensor threshold crossed Alarm sounds Phone Message received Data arrives Notification displayed Fridge Temperature rises Threshold exceeded Compressor starts Automatic door Person approaches Motion detected Door opens ✅ Summary Events are everywhere — in your home, your city, and your devices. A smoke alarm, an automatic door, a traffic light, a phone notification — all of these involve a trigger (something that causes the event), an event (the thing that happens), and a response (what the programme does). Events can also chain together: one response becomes the trigger for the next event. Once you start spotting this pattern, you will see it in almost every device and system around you. Coming up next: Events Inside Computer Programs — how programmes are written to listen for events and run the right commands when they occur.