Section outline

    • 🚦 What Is an Event?

      In the world of programming, an event is something that happens — and the robot reacts to it.

      Think of it like this:

      • 🔘 You press a button → the robot starts moving

      • Your hand comes close → the robot waves

      • 5 seconds pass → the robot beeps

      These are all events. They trigger something to happen.


      🧠 What Is Input?

      Input is the information the robot receives from outside — like from a sensor, button, or timer.

      🟢 Input: Button is pressed

      🔴 Input: Light sensor detects darkness
      🟡 Input: Timer says 10 seconds passed

      🧃 Real-Life Examples

      Event or Input Robot Action
      Button press Toy robot starts dancing
      Clapping sound Robot dog barks
      Timer runs out Smart light turns off
      Obstacle ahead Vacuum robot changes direction

    • 🧩 Why Events Matter

      Without events, a robot would keep running the same thing forever.

      Events help robots be interactive and smart.

      It’s like giving the robot ears, eyes, and a clock so it knows when to do something.
    • 🧪 Try It Out – Paper Robot Example

      Draw a robot on paper.

      Now imagine these:

      • 🟢 Someone claps

      • 🔵 The room gets dark

      • 🔴 Someone taps a button

      Ask yourself:

      What should your robot do when this happens?

      Draw the actions. That’s event-driven thinking!


      🤖 Robot Code Logic Example

       

      vbnet

      CopyEdit

      When button is pressed: Move forward When obstacle is detected: Stop Turn left

      Each "When..." is an event, and the lines below are the response.


      🧠 Challenge: What Events Happen Around You?

      Look around your home or school.

      • What turns on when you walk near it?

      • What happens when someone presses a switch?

      All of those are event-based actions, just like in robot logic.