← Free Lesson Plans for Teachers Free Lesson Plan Grade 5Engineering & Coding2 sessions x 50 minmicro:bitBit Board1B-AP-101B-AP-15 ⬇ Download PDF (lesson, student sheets & answer key) Driving question: How can we write a program that reacts when someone presses a button? Students connect two contrasting jumbo LEDs and a jumbo pushbutton to a micro:bit through a Bit Board expansion board and program them with block code (Microsoft MakeCode). They build up from a sequence (light on, wait, off) to a loop (blink forever), then an event (on button A pressed), and finally a conditional reading an external Bit Board pushbutton on Pin 4 (if digital read pin P4 = 0, show Go light; else Stop light). Each step includes a planted bug for students to find and fix. Teams finish by designing a "crosswalk signal" program. CSTA K-12 CS Standards (2017), Level 1B (grades 3-5). This lesson has not been reviewed or endorsed by CSTA. Students will: Geyer resources for this lesson Exit ticket: "Explain the difference between an event and a conditional. Give an example of each." Use these sheets in class, or download the PDF for a print-ready layout. Student Sheet 1 Print-ready version in the PDF. Name: ______________________________ Date: ______________ Which construct (sequence, loop, event, conditional) did each fix involve? Student Sheet 2 Print-ready version in the PDF. Name: ______________________________ Date: ______________ An event starts code when something happens (on button A pressed). A conditional checks a condition while code runs in a loop and chooses what to do (if digital read pin P4 = 0 then ... else ...). Need a print-ready copy? The PDF includes the lesson, student sheets, and answer key. Free for classroom use. You may print and copy this lesson for your students. © Geyer Instructional Products. Standards text: CSTA K-12 CS Standards © CSTA.Overview
Standards
Code Standard CSTA 1B-AP-10 (2017) programs with events, loops, and decisions CSTA 1B-AP-15 (2017) testing and fixing a program Learning Objectives
Materials
1 per pair (12 sets for a class of 24): expansion board, 4 jumbo 10 mm LEDs, 2 jumbo pushbuttons, piezo speaker, Maker Tape, and guide cards (micro:bit sold separately).
Classroom packaging option for groups of 2-3 students.Also needed
Vocabulary
Word What it means sequence Steps that run in order. loop Code that repeats. event Something that happens (like pressing built-in button A) that starts code. conditional An if/then (else) choice in code. bug A mistake in a program. debug To find and fix mistakes. pin A connection point on the micro:bit and Bit Board for parts. Safety Notes
Before You Teach
Warm-Up (5 min)
Procedure
Sequence and loop (20 min)
Events (25 min)
Conditionals (25 min, Session 2)
Crosswalk challenge (25 min)
Differentiation
Support On-level Challenge • Start from a partly built program.
• Use only the micro:bit built-in buttons A and B before adding the Bit Board button.
• Pair programming with clear driver/navigator roles.• Complete the procedure and student sheets as written. • Add a countdown on the LED matrix.
• Use a variable to count button presses.
• Add a potentiometer to change the blink speed.Assessment
Criterion Beginning Developing Proficient Uses constructs Sequence only Sequence and loop Sequence, loop, event, and conditional Debugging Cannot find bugs Finds bugs with help Finds and fixes bugs and explains them Crosswalk program Does not run Runs, misses a test case Passes all test cases Extensions
Student Sheets
Bug Hunt
Bug What the code does What it should do The fix 1 LED turns on once and never blinks Blink forever 2 Pressing button A does nothing LED turns on when button A is pressed 3 Go LED is always on (even when Bit Board button is not pressed) Go LED only when button on P4 is pressed 4 Both LEDs on at the same time Only one LED on at a time Crosswalk Signal Design and Tests
Test case Expected Actual Pass? No button press for 10 s Stop LED stays on Press button once Go LED 5 s with beeps, then Stop Press button during Go Go keeps going, then Stop Show answer key (for teachers)
Answer Key & Teacher Notes
Bug Hunt
Exit ticket
Plan your program (pseudocode or sketch of blocks).
