Studyfin Studyfin ✨ Sign up free

Input & output basics

Grade 6 · Coding · Free lesson

Hey there! Ready to control your computer? Today we will learn how coding uses input and output to solve real-world problems.

Every app you use needs information to work. Input is any data you send to the computer, like clicking a button or typing. Output is what the computer does or shows back to you, like playing a sound or showing a picture.

Let us design a program to solve a real problem: a smart pet bowl! The input is a sensor detecting that the bowl is empty. The output is a motor opening to drop yummy food for your puppy.

INPUT Empty Bowl Sensor OUTPUT Dispense Food

We use logic to connect inputs and outputs. A conditional block like 'IF the bowl is empty, THEN open the food gate' makes the magic happen. This creates an automated sequence that solves our daily chore!

IF Bowl is Empty THEN Fill the Bowl
✏️ Worked example

Let us design a program for an automatic nightlight. We want the light to turn on only when it gets dark in the room. How do we build this using our design process?

  1. Identify the input: We need to detect light levels. A light sensor will act as our input.
  2. Identify the output: We want to light up the room. A LED bulb will act as our output.
  3. Write the conditional logic: We create a rule. IF the light sensor reads less than 10 (dark), THEN turn on the LED.
  4. Test the sequence: When you cover the sensor with your hand (input), the LED shines bright (output) instantly!
Want the full interactive lesson — quiz, animations, and Finn cheering them on?

More Coding lessons