Brain DeCoded with CodeX - Mission 2, Objective 4: Neural LinkUP
Neural LinkUP
Students chain their CodeX devices together over radio, turning a room full of single neurons into one working network.
Overview
Objective 3 gave every student one neuron on one CodeX. This objective wires them together. The program neural_network1 uses the CodeX radio to pass a signal from one device to the next, so the unplugged chain from Objective 2 runs for real, in code, across the room.
You have two ways to run it. One long chain with the whole class is the simplest, and the only code change is setting CHAIN_NUM to the number of students. Or split into teams, where each team forms its own chain on its own radio channel. Teams need nonadjacent channels, all even or all odd, or they will pick up each other's signals.
🎯 Project Goal: Students add code to a program that simulates a single neuron network.
Learning Targets
- I can collaborate in a team to form a neural chain using the CodeX devices.
- I can write a program that uses a radio signal to communicate with other CodeX devices.
Key Concepts
- The program uses a radio signal for communication.
- If the class is divided into multiple teams, assign each team a different nonadjacent radio channel.
Assessment Opportunities
- Turn in the Activity Guide.
- Complete the program neural_network1.
Success Criteria
- Complete the CodeTrek steps
- Program runs correctly without errors
- Activity Guide is completed
Digital Resources
Classroom Materials
- ▸CodeX device and USB cable, one per student
- ▸Laptop/computer with Chrome browser
Extensions & Cross-Curricular
randint range in send_signal(), any value added to or subtracted from strength, and the value added to start_time.
🐍
New Python Code
▾
📐
Standards
▾
Computer Science
- Decide up front whether you are running one class-wide chain or multiple team chains. That choice changes what students type, so make it before class starts.
- If you are using teams, pick the radio channels yourself ahead of time. Use all even or all odd numbers so no two teams sit on adjacent channels.
- Decide how students get the Activity Guide. You can print a copy for each student or assign it digitally.
- Read the Hints in the objective. They add detail that complements the instructions in the Activity Guide.
- Plan your room layout and how students will physically line up as a chain, and count heads so you know the number to use for the chain length.
- The Hints give additional information about the activity. You may want to emphasize this or review with the students. It complements the instructions in the activity guide.
- The Objective has an Activity Guide for students, which can be printed or assigned digitally.
-
This is a single chain simulation. It can be run as a class and one long chain. If you use this option, the only change in code is for each student to put the number of participants (students in class) as the value for
CHAIN_NUM. -
Or, you can place students in teams, and each team can form its own chain. If you divide the class into teams, each team needs to be on its own channel. Please assist teams in selecting channels. They should not be adjacent. For example, use even numbers or odd numbers. Then the changes in code are for the students to put the number of participants (students in the team) as the value for
CHAIN_NUMand the number of their radio channel forTEAM_CHANNEL. - Make sure that when students run the code and assign roles, that no role number is skipped. A gap in the roles breaks the chain and the signal will not make it to the end.
- Extensions and cross-curricular projects are included to enhance the concepts in the objective. You can use the extensions to extend students' learning.
Lesson Outline
Point back at the two things students have already built.
- Ask: "You each have one neuron running on your CodeX. What would it take to connect them into the chain we made with our bodies in Objective 2?"
- Ask: "If every CodeX in the room is shouting on the same radio channel, what goes wrong?"
Get the structure sorted before anyone starts coding.
- Tell students whether you are running one class chain or team chains.
- Assign roles in order and confirm out loud that no role number is skipped. Have students say their number down the line.
-
Give students the chain length to use for
CHAIN_NUM. For teams, also give each team its radio channel forTEAM_CHANNEL, keeping the channels nonadjacent. - Hand out or assign the Activity Guide, and review the Hints with the class.
Students build neural_network1 and run the network.
- Students work through the CodeTrek steps, adding code to neural_network1.
-
Students set their constants and variables, including
CHAIN_NUMand their own role number. - Run the chain. The signal should travel from the first role to the last with no gaps.
- Run it several times, then complete the Activity Guide. Fast finishers move to the extension and start adjusting values.
Compare the coded network to the human one.
- Discussion: how was the coded chain different from the unplugged chain in Objective 2, and what stayed the same?
- Ask: "What is the radio signal standing in for in a real brain?"
- Collect the Activity Guides.