Welcome to your first lesson in Computer Science. This subject studies computers and computational systems, focusing on how they process information and solve problems through algorithms—step-by-step instructions that computers follow. It underpins technologies you use daily, such as smartphone apps, online banking, and navigation systems.
Computer Science extends beyond programming to include designing efficient solutions, managing data, and understanding hardware. It’s a field that drives innovation across industries, and in this lesson, you’ll begin exploring it by writing a simple program.
Computer Science is a broad discipline with several key areas, each offering distinct career opportunities. Here are some core fields:
Career paths include software developers who build applications, cybersecurity analysts who safeguard data, AI researchers who advance technology, and network engineers who connect the world. These roles shape the future, and this course is your starting point.
The microbit is a compact programmable device used in this course to learn Computer Science concepts. It features a 5x5 LED grid for displaying text or patterns, two buttons (A and B) for input, and sensors to detect motion or temperature. You’ll program it to perform tasks, starting with displaying a message. If you have a physical microbit, examine its components. If not, you’ll use an online simulator. This tool bridges code and hardware, giving you practical experience in how computers execute instructions.
To begin coding, open a web browser and navigate to python.microbit.org/v/3. This is the microbit Python editor, an online platform for writing and testing Python code.
The left side provides a text area for coding, while the right side displays a simulator mimicking a microbit. Below the simulator, locate the “Run” button to execute code and the “Send to microbit” button to transfer it to a physical device. Spend a moment exploring the interface—find the “Run” button and observe the blank simulator—before proceeding.
To create a new Python project for a Microbit, open the website python.microbit.org.
This will open the code editor with a new project. It might have some example code already added such as:
# Imports go at the top
from microbit import *
# Code in a 'while True:' loop repeats forever
while True:
display.show(Image.HEART)
sleep(1000)
display.scroll('Hello')
You should delete this code except for the import
line that you will need. This imports the necessary libraries you will need to code a microbit.
# Imports go at the top
from microbit import *
You’ll now write your first program to display “Hello, World!” on the microbit. Enter the following code into the editor:
from microbit import *
display.scroll("Hello, World!")
Click “Run” to test it. The simulator’s LED grid will scroll “Hello, World!” across its 5x5 display, as it’s too small to show the full message at once. If you have a microbit connected via USB, click “Send to microbit,” download the file as prompted, and drag it to the device to see it in action. This demonstrates how code controls hardware—a fundamental aspect of Computer Science.