Brain DeCoded with CodeX - Mission 1, Objective 7: Link Up

Mission 1 · Objective 7 Lesson Plan

Link Up

Students turn on the CodeX radio, set a channel, and send and receive messages with their classmates.

⏱ 20-40 min 🎯 Grades 8-12+ 💻 CodeSpace 🎮 CodeX 🐍 Python
View Lesson Outline
📋

Overview

Objective 7 closes out Mission 1 by connecting the whole class together. Students import the radio module, turn the radio on, set a channel, and then write a program called class_connect that both sends a message and listens for messages coming back.

The CodeX has 13 radio channels. Every CodeX set to the same channel can send and receive with every other one, so the activity works as a whole-class network or as smaller groups on different channels. Students add their own name to the message they send, which is what turns a screen full of text into a readable conversation.

🎯 Project Goal: Students will send and receive a message using the CodeX radio.

🎯

Learning Targets

  • I can turn on the CodeX radio and set a channel.
  • I can send a message using a radio signal.
  • I can receive a message using a radio signal.
  • I can clear the CodeX LCD screen.
💡

Key Concepts

  • The CodeX has 13 channels. Any CodeX on the same channel can send and receive messages.
  • If a CodeX is on channel 6 and another CodeX is on an adjacent channel, the messages can cross over.

Assessment Opportunities

  • Complete the program class_connect.
  • Exit ticket: explain how to set up the radio.
  • Exit ticket: explain how to send or receive a message.

Success Criteria

  • Complete the CodeTrek steps
  • Program runs correctly without errors
  • Message sent and received on the class channel
📂

Digital Resources

  • Radio tool in the CodeSpace Toolbox, the reference for the radio functions students use here
  • Project CodeTrek step 2 on the board, that is the step where students add their name to the message
🧰

Classroom Materials

  • CodeX and USB cable, one per student
  • Laptop/computer with Chrome browser
  • Board or projector to post the channel number each group is using
  • Paper and pencil for the exit ticket
🚀

Extensions & Cross-Curricular

ExtensionAdd code to turn the pixels one color (or display an image) when sending a message, and another when receiving a message or clearing the screen.
ExtensionFor advanced students, a CodeX connected to a computer can receive input from the keyboard. Students can customize the message they send using an input() function.
Phys SciLearn about radio signals, how they carry information and what affects their range.
MathForm a human chain and record the time it takes for students to pass a message through the chain one at a time. Graph the results and construct an equation.
Lang ArtsThe objective opens with the inspiration for Dr. Neuron Sparks. Have students write about what inspires them.
🔤

Vocabulary

Radio Communication:point to point packet communication between multiple CodeX. All CodeX set to the same channel can send and receive messages with each other.
🐍

New Python Code

import radioAccess the functions from the radio library. Must be the first instruction in the code.
radio.on()Turn on the radio.
radio.config(channel=6)Set the radio channel to 6.
radio.send(msg)Send the text msg across the radio channel.
msg = radio.receive()Listen for a message from the radio channel and assign the text to msg.
if msg:If a message is received, run the block of code.
display.clear()Clear the LCD screen.
📐

Standards

Computer Science - Grades 9-12

9-12.AP.17
📝
Preparing for the Lesson
  • Work through Objective 7 yourself and send a message between two CodeX so you know what the screen looks like on both ends.
  • Decide up front whether the whole class shares one channel or you split into groups. If you split, remember that adjacent channels can cross over, so leave a gap between the channel numbers you assign.
  • Post the channel number (or the group channel list) somewhere everyone can see it. If channels do not match, nothing arrives.
  • Make sure every student has a CodeX and USB cable ready before you start.

🧑‍🏫
Teacher Notes
  • The code to import the radio module MUST be first. It sets up the memory.
  • Students need to add their name to the message so you can tell who is sending it. The instructions are in CodeTrek (step 2), but you may want to emphasize this.
  • If you have a lot of students, this activity can get a little crazy. That is the fun of it! Students can clear their screen any time by pressing BTN_B.
  • Extensions and cross-curricular projects are included to enhance the concepts in the objective. You can use the extensions to extend students' programming experience.
🗺️

Lesson Outline

🗣️Warm-up / Hook

Open with a quick discussion about how devices talk to each other.

  • Ask: "Your phone has no cable running to anyone else's. So how does a text message actually get there?"
  • Ask: "If everyone in this room shouted at once, how would you know who was talking to you?"
Teaching tip: Hold the second question. It is the reason students have to put their name in the message, and it will make sense to them the moment the screens start filling up.
📖Introduce the Objective

Set up the radio before anyone starts typing. Three things to make clear:

  • Import comes first. import radio has to be the first instruction in the program because it sets up the memory. This is not a style preference, the program will not work otherwise.
  • Channels have to match. The CodeX has 13 channels, and only devices on the same channel can talk. Announce the class channel now. Mention that adjacent channels can bleed into each other, so a stray message is not a bug.
  • Names go in the message. CodeTrek step 2 walks through this. Emphasize it, or the class ends up with a screen of anonymous text.
Teaching tip: Write the channel number on the board and leave it there. Nearly every "it isn't working" in this objective is a channel mismatch.
💻Student Work Time

Students build class_connect in CodeSpace, following the CodeTrek steps.

  1. Import the radio module, turn the radio on, and set the channel.
  2. Add their name to the message they will send (CodeTrek step 2).
  3. Send the message with radio.send() and watch for it to appear on a classmate's screen.
  4. Listen for incoming messages with radio.receive() and display them only when something actually arrived.
  5. Clear the screen with display.clear() when it gets full, using BTN_B.
  6. Run the program and confirm it sends and receives without errors.
Teaching tip: This gets loud and a little chaotic with a full class. That is the fun of it. Let it run for a few minutes before you rein it in, then point out that the screens are unreadable and ask what would fix that.
✏️Wrap-up & Review

Close with a short exit ticket. Either one works:

  • Explain how to set up the radio on the CodeX, in order.
  • Explain how to send a message, or how to receive one.
Teaching tip: Students who finish early have somewhere to go: have them light the pixels one color when sending and another when receiving, or, if they are connected to a computer, use input() to type a custom message from the keyboard.