Hey there! Ready to build something awesome? Today, we will design a smart robot nightlight that turns on when it gets dark!
Physical computing means connecting software to the real world. We write code on a computer, and that code controls real physical objects like sensors, motors, and lights.

Every smart gadget follows a simple design process. First, we find a problem, like needing a light at night. Next, we plan a sequence of steps to solve it.
To make our nightlight smart, we use a conditional 'if-then' statement. If the light sensor detects darkness, then the code triggers an event to turn the light bulb on.
Let's design a program for an automatic nightlight. Walk through the design process step-by-step to create the logic for this everyday device.
- Identify the Goal: We want a light bulb to turn on automatically only when a room gets dark.
- Choose the Inputs and Outputs: The input is a light sensor (detects brightness). The output is an LED bulb.
- Write the Sequence: Create a loop that constantly checks the light sensor's value.
- Add the Conditional: Inside the loop, add an 'if-then-else' block. If 'light level < 30', then set 'LED to ON'. Else, set 'LED to OFF'.
- Test and Refine: Run the program. If the light turns on too early, adjust the threshold number from 30 to a lower number.
