Cyberpi Block Based Coding Basic Course Material
Cyberpi Block Based Coding Basic Course Material
Objectives
Overview
Meet the CyberPi, a feature‐rich micro‐controller with a plethora of sensors, buttons and a full‐color screen
display. Discover a variety of key features of CyberPi through an exploration of sample programs in mBlock.
Key Focus
Pre‐lesson Checklist
© education.makeblock.com 1
Computer with mBlock 5 installed or mBlock Web version
CyberPi with USB‐C cable
Pocket Shield (optional)
Example program(s) included in mBlock software
Content Standards
Duration Content
Warm‐up
5 minutes
Meet the CyberPi
Hands‐on
Tour of mBlock 5
Connect the CyberPi
15 minutes o Add the CyberPi Extension
o Test Live Mode
Explore an Example Program
o Test Upload Mode
Try It
20 minutes
Explore Example Programs
Wrap‐up
Reflect on the CyberPi Features and Capabilities
5 minutes
Brainstorm Ideas for CyberPi Programs
Lesson Extension(s)
© education.makeblock.com 2
Activities
Warm‐Up
[5 minutes]
Hands‐On
[15 minutes]
Tour of mBlock 5
1. Open the mBlock 5 software or mBlock 5 Web version.
2. Introduce students to the following key areas of the software interface:
© education.makeblock.com 3
Name of Area Function
Select language
Menu Bar Create, open or save the file
Find an example program, help file, etc.
© education.makeblock.com 4
Not Connected Connected
7. Notice, the CyberPi is connected in Live mode. Let’s test the connection.
8. In the Block Area, choose the LED category.
9. Click the block. Observe the CyberPi as the LED strip displays the colors
indicated.
Explore Example Programs
10. Click Tutorials in the upper right corner. Select Example Programs.
11. Choose the CyberPi label to see example programs for the CyberPi.
12. Find and select the Rainbow Lights program.
13. Have students read the code and predict what will happen.
14. Connect the CyberPi in Live mode.
15. Click the block. Observe the CyberPi as the LED strip displays the colors
indicated. (Note, a glowing yellow border surrounds the script in the Script area indicating the script is
running.) Click the blocks to stop the program.
16. Explain to students the difference between Live mode and Upload mode.
Mode Description
© education.makeblock.com 5
CyberPi can be disconnected from the computer
mBlock software may be closed
Program will remain on CyberPi until a new program is
uploaded in its place
17. Switch the CyberPi to Upload mode and click the Upload button.
18. The Upload Progress window will appear and will disappear when uploading is complete. The CyberPi
will reboot and observe the Rainbow Lights program. Every time the CyberPi starts up, the Rainbow
Lights program will run.
Try It
[20 minutes]
Wrap‐Up
[5 minutes]
© education.makeblock.com 6
1. Facilitate a discussion for students to share about their favorite example projects. Encourage
students to identify the CyberPi features and capabilities they are most excited to learn about.
2. Have students document what they hope to learn while completing these lessons and any
questions they may have.
3. Now that students have seen some examples of the CyberPi in action, encourage them to
brainstorm ideas for a problem in their daily life that they want to solve using the CyberPi and
mBlock.
Lesson Extension(s)
If students need additional support using mBlock, consider having the students complete the
mBlock 5 Getting Started Activities.
© education.makeblock.com 7
Lesson 2
Sound Machine
Objectives
Overview
In this lesson, students create a disco party using the on‐board LEDs and speaker. This program will use the CyberPi
buttons to trigger events and run scripts. Students will also program a button to stop all sounds and lights, as well
as a button to restart the CyberPi.
Key Focus
Pre‐lesson Checklist
© education.makeblock.com 8
Computer with mBlock 5 installed or mBlock Web version
CyberPi with USB‐C cable
Pocket Shield (optional)
Content Standards
Duration Content
Warm‐up
5 minutes
Input vs. Output
Hands‐on
Plan a Program with Pseudocode
15 minutes Write the Program
Randomizing the Output
Restart a CyberPi
Try It
20 minutes
Create a Sound Machine
Wrap‐up
5 minutes Project Showcase
Lesson Extension(s)
© education.makeblock.com 9
Activities
Warm‐Up
[5 minutes]
Term Definition*
4. Using a smartphone as an example, have students work in pairs or small groups to create a list of the
input and output for a mobile phone. Some examples may include:
Smartphone
Input Output
Microphone Speaker
Touch Screen Screen / Display
Buttons Headphones
GPS Vibration
Motion Sensor (tilting the phone) Internet connection
Light Sensor LED (flashlight / camera flash)
Camera Charging Port
Internet connection Bluetooth
Temperature Sensor
Charging Port
Bluetooth
5. Have students reflect on Lesson 1 – Meet the CyberPi and create a list of the input and output for the
CyberPi. Encourage students to refer back to the product documentation included with the CyberPi if
they get stuck.
CyberPi
© education.makeblock.com 10
Input Output
Microphone Speaker
Buttons (A, B & Home) Screen / Display
Joystick LED Strip
Charging Port Indicator LED (shows charging & power on)
Bluetooth
Motion Sensor (gyro)
Light Sensor
Volume/Sound Sensor
Hands‐On
[15 minutes]
Term Definition
20. Using the following project description, guide students through writing the pseudocode for the project.
Sound Machine
© education.makeblock.com 11
When middle joystick button is pressed:
Stop all sounds and lights
21. Have students examine the pseudocode above and identify the input and output for the program.
Input Output
Loop Statement
Continuously execute the actions
nested inside the block.
© education.makeblock.com 12
Turns off all or an individual on‐
board LED.
2. Open the mBlock 5 software or mBlock 5 Web version. Add the CyberPi in the Devices tab and connect
in Live mode.
3. Remind students how to drag‐and‐drop blocks from the color‐coded categories in the Block Area.
Instruct them to build each of the following scripts:
Note, the middle pressed option can be found on the drop‐down menu.
© education.makeblock.com 13
Computer or CyberPi selects a
random value between the
specified range.
Note, these ranges correspond to the range of values accepted for each block.
9. Have students test the new program. Note, students can change the seconds value in the play buzzer
block to a decimal if they would like a faster buzzer sound.
Restart a CyberPi
10. Programming a button to restart the CyberPi can be a helpful tool in upcoming lessons. So, guide
students through programming a button to manually restart the CyberPi.
11. Instruct students to build the following script and test the program:
Try It
[20 minutes]
© education.makeblock.com 14
4. Challenge students to explore other blocks in the LED and Audio categories in the Block Area. Some
blocks of interest may be:
5. Once they’ve explored the various blocks. Have students write pseudocode for an enhanced version of
the Sound Machine project.
6. Have students create their project using their pseudocode as a guide.
Wrap‐Up
[5 minutes]
Project Showcase
4. Group students into pairs and have students present their CyberPi Sound Machine to their
partner.
5. Have students ask each other the following questions:
a. What feature of your project are you most proud of?
b. What was most challenging about this project?
Lesson Extension(s)
Program a stop button using the Repeat Until block with the block.
Use the joystick buttons to program multiple different sounds and light shows.
© education.makeblock.com 15
Lesson 3
Sound Recorder
Objectives
Overview
By combining the speaker, microphone and integrated storage, students will transform the CyberPi into a pocket‐
sized audio recorder and playback device. Through an iterative process, students will evaluate their projects and
improve their sound recorders.
Key Focus
Pre‐lesson Checklist
© education.makeblock.com 16
Computer with mBlock 5 installed or mBlock Web version
CyberPi with USB‐C cable
Pocket Shield (optional)
Content Standards
Duration Content
Warm‐up
10 minutes
Evolving Computing Solutions
Hands‐on
10 minutes Make a Plan
Create Sound Recorder 1.0
Try It
20 minutes
Plan and Create Sound Recorder 2.0
Wrap‐up
5 minutes Summarize
Lesson Extension(s)
Activities
© education.makeblock.com 17
Warm‐Up
[10 minutes]
7. Discuss with students how computing solutions have evolved over time.
Here is a specific example you may want to share:
o Using a printed road map or transit map to determine a route from one place to
another prior to departure.
o Using a website on a computer to generate printable directions prior to
departure. (i.e. Mapquest or a transit website)
o Using a mobile device to view a website with directions while in route.
o Using a mobile device to view a map while in route (no directions provided).
(Note, this was the first iteration of the Google Maps app; it had no directions.)
o Using a mobile device to view a map with driving directions or transit directions.
o Using a mobile device to provide turn‐by‐turn GPS driving directions (no transit or
walking support, yet).
o Using a mobile device to provide turn‐by‐turn GPS driving directions with route
adjustments based on live traffic data.
o Using a mobile device to provide GPS‐assisted driving, walking, or transit
directions in real‐time.
The use of GPS directions on a smartphone or mobile device has evolved over time. For
example, the first iteration of Google Maps was missing many key features (i.e., walking
directions, public transit, live traffic, road closures, destination information, etc.) which
have been added over time through evaluation of the solution, user feedback and data
collection.
Hands‐On
[10 minutes]
Make a Plan
© education.makeblock.com 18
22. Using the following problem statement, guide students through planning a solution to the problem. A
sample solution has been provided for you. Note, keep the initial solution very simple. This will allow
for students to iterate and add features as they work on developing a feature‐rich sound recorder.
How can the CyberPi be used to help your classmate with this
problem?
© education.makeblock.com 19
Starts recording audio.
Limited to a 10 second recording.
24. Open the mBlock 5 software or mBlock 5 Web version. Add the CyberPi in the Devices tab and connect
in Live mode.
25. Remind students how to drag‐and‐drop blocks from the color‐coded categories in the Block Area.
Instruct students to build the following scripts and test the program:
26. Ask students if the device is ready to give to the classmate to use in their foreign language class. Many
students will begin to identify areas of improvement for this design. Have students brainstorm and
create a list of ways to improve this basic sound recording device. If students need additional guidance,
consider asking the following questions:
a. How will your classmate know how to use the CyberPi Sound Recorder?
b. How will your classmate know if the CyberPi is recording?
c. What other features could be useful for your classmate?
d. What other components of the CyberPi can be used to create a more feature‐rich solution?
(i.e., display, LED strip, speaker, motion sensor)
Try It
[20 minutes]
© education.makeblock.com 20
1. Explain to students that programmers and software developers improve upon their solutions often.
(Note, this is why software apps have updates and redesigns.) Software development is an iterative
process.
2. Using the list of improvements they created in the previous section, have students identify the three
most important features they would like to add to the Sound Recorder program.
3. Have students describe and justify the features they will be adding. Then, have students write the
pseudocode for each feature. A sample plan is provided below:
Add instructions to the display telling the user what buttons to press to
control the CyberPi Sound Recorder.
Feature #1
When the CyberPi starts up:
Display on the screen:
“Press A to start, Press joystick to stop, Press B to play”
Use the LEDs to tell the user when the CyberPi is recording.
Wrap‐Up
© education.makeblock.com 21
[5 minutes]
Summarize
1. Have students share a few of the ideas they incorporated into their sound records.
2. Remind students that the next activity will have them continue developing the Sound Recorder project
through an iterative process.
Lesson Extension(s)
Have students explore UX Design (User Experience Design) and the role it plays in software
development.
Have students research accessibility and usability with software development.
© education.makeblock.com 22
Lesson 4
Sound Recorder Iteration
Objectives
Overview
Continuing with the Sound Recorder project, students will acquire peer feedback and reflect on their initial
solution. Then, students will plan and create a feature‐rich, sound recorder project.
Key Focus
Pre‐lesson Checklist
© education.makeblock.com 23
Computer with mBlock 5 installed or mBlock Web version
CyberPi with USB‐C cable
Pocket Shield (optional)
Content Standards
Duration Content
Warm‐up
15 minutes
Collect Peer Feedback
Try It
20 minutes
Plan and Create Sound Recorder 3.0
Wrap‐up
10 minutes Project Documentation
Lesson Extension(s)
Activities
Warm‐Up
[15 minutes]
© education.makeblock.com 24
Collect Peer Feedback
6. With the entire class, conduct a formal peer review and feedback activity. Explain how software
developers rely on user feedback, reviews and data to plan for additional iterations of a computing
solution.
7. Have students place their plan for Sound Recorder 2.0 on their desk, open the program in mBlock
and place the CyberPi with the uploaded recorder on their desk.
8. As time permits, have students rotate around the room and provide feedback on their classmates
projects. Some guiding questions for feedback may include:
a. What feature do you like best about their project?
b. Were instructions clear on how to use their recorder? Did you have to guess or make any
assumptions on how to use it?
c. Is there anything they could add to their project to make it more user‐friendly?
d. Is there a feature you think would enhance their recorder project?
Try It
[20 minutes]
Wrap‐Up
[10 minutes]
© education.makeblock.com 25
Project Documentation
1. Now that students have created a feature‐rich sound recorder, have them write a description for
their recorder that explains the features they have included in their design.
Lesson Extension(s)
Have students collect feedback from a variety of stakeholders (i.e., parents, teachers, friends,
etc.).
Have students add improvements to a different student’s project.
© education.makeblock.com 26
Lesson 5
Game Controller
Objectives
Overview
In this lesson, students will turn the CyberPi into a game controller by combining device programming and stage
programming in mBlock. Students will examine example programs to discover how the CyberPi can control the
movement of a sprite. Then, through pair programming, students will modify an existing game to program a
CyberPi game controller.
Key Focus
Pre‐lesson Checklist
Content Standards
Duration Content
Warm‐up
5 minutes
Video Game Discussion
Hands‐on
15 minutes Explore Example Games
Abstraction and Decomposition
Try It
20 minutes Pair Programming
Modify an Example Project
Wrap‐up
5 minutes Respecting Intellectual Property
Lesson Extension(s)
Activities
© education.makeblock.com 28
Warm‐Up
[5 minutes]
Hands‐On
[15 minutes]
Term Definition
5. Have students examine their assigned example program and differentiate between the stage
programming and the device programming.
Note, device programming will be on the device(s) listed on the Devices tab and stage programming
will be on the sprites and backdrops listed on the Sprites and Background tabs.
© education.makeblock.com 29
Abstraction and Decomposition
6. Students will be using computational thinking strategies, abstraction and decomposition, to examine
the example projects and determine how to modify an existing game to add a CyberPi game controller.
They will use abstraction to ignore or filter out parts of the program that are unnecessary to the
challenge and use decomposition to break down the stage programming and device programming parts
that are needed to create the controller.
Term Definition
7. Instruct students to carefully examine their assigned game and to complete the following challenge:
Game Controller
You are tasked with taking an existing program and adding a CyberPi
Problem game controller. Use the example program to learn how to complete
this task.
Computational Thinking
Space Game
Abstraction o The Title, ball, asteroids and health sprites
o The background
o The “when I receive gameStart” scripts
Chase Game
o The Title and Bat sprites
© education.makeblock.com 30
o The background
o The “when I receive gameStart” scripts
8. Through the exercise above, students should have discovered the following blocks:
Conditional Statement
Executes the actions nested inside
if a condition is met.
Try It
[20 minutes]
Pair Programming
5. Students will be working with a partner to add a CyberPi game controller to an existing project.
Introduce students to the Pair Programming roles:
Pair Programming
Navigator Keeps track of the big picture and helps to decide what to do next.
Driver The person using the computer actually writing the code.
© education.makeblock.com 31
*Definitions from Code.org – CSD Unit 1
6. Have students switch roles every 3‐5 minutes during the portion of the lesson.
Wrap‐Up
[5 minutes]
Lesson Extension(s)
Have students research intellectual property, copyright, creative commons and citations.
Have students create a new game that incorporates stage programming and device programming.
Have students add a title and game instructions to the project.
© education.makeblock.com 32
Lesson 6
Sensor Meter
Objectives
Overview
Discover how the on‐board sensors on the CyberPi represent loudness and light intensity of the surrounding
environment. Students will learn about data representation and graphing of sensors values.
Key Focus
Data representation
Debugging programs
Understanding sensors
Pre‐lesson Checklist
© education.makeblock.com 33
CyberPi with USB‐C cable
Pocket Shield (optional)
Example program(s):
CyberPi – Lesson 6 – Sensor Meter
Content Standards
Duration Content
Warm‐up
5 minutes
Data and Society
Hands‐on
15 minutes Exploring Sensor Data
Charting the Sound Sensor
Try It
20 minutes
Charting the Light Sensor
Wrap‐up
5 minutes Documentation
Lesson Extension(s)
Activities
Warm‐Up
[5 minutes]
© education.makeblock.com 34
27. Find a current event about smart home devices to present to the class. Discuss how these solutions use
sensors to provide security, convenience and automation for consumers.
Hands‐On
[15 minutes]
5. Introduce students to the blocks that are used for the sensors on the CyberPi:
© education.makeblock.com 35
Stores a numerical value
representing the volume detected
by the sound sensor on the
CyberPi.
7. Open the mBlock 5 software or mBlock 5 Web version. Add the CyberPi in the Devices tab and connect
in Live mode.
8. Instruct students to build the following script and test the program:
Try It
[20 minutes]
© education.makeblock.com 36
2. Some solutions may, at first, appear to be correct. But, encourage students to think critically and fully
test their solution. For example, the following code does not properly graph the data. When testing this
code, you should observe that speaking loudly by the CyberPi makes both the red and blue lines
increase.
3. Encourage students to persevere through fixing or debugging their code until they get the correct
solution. The following is a correct solution:
Wrap‐Up
[5 minutes]
Documentation
© education.makeblock.com 37
1. When programming, it can be helpful to document programs to make them easier for someone to
follow, test and debug. Often, multiple programmers work on one project. Instruct students to use a
comment(s) to explain how the code works.
Lesson Extension(s)
Have students program the LEDs or speaker to react to the loudness or light intensity.
Have students add a title and game instructions to the project.
Have students program a sprite or background to change costumes based on the loudness or light
intensity. (Note, a variable is required to store each sensor value.)
© education.makeblock.com 38
Lesson 7
Color Mixer
Objectives
Overview
Students will be introduced to variables to create a CyberPi Color Mixer. This program will use the joystick and
buttons to control the R, G, B color values of all of the on‐board LEDs. Then, students will use conditional
statements to ensure that the R, G, B values do not go out‐of‐range.
Key Focus
Pre‐lesson Checklist
Content Standards
Duration Content
Warm‐up
5 minutes
Conditional Statements Game
Hands‐on
15 minutes Storing Data with a Variable
Using a Conditional Statement
Try It
20 minutes
Completing the Program
Wrap‐up
5 minutes Variables
Lesson Extension(s)
© education.makeblock.com 40
Activities
Warm‐Up
[5 minutes]
Hands‐On
[15 minutes]
Term Definition*
10. Review the following challenge and pseudocode with the students:
Color Mixer
Project Create a project where the joystick and buttons on the CyberPi control
Description the R, G, B values of all of the LEDs.
© education.makeblock.com 41
When the joystick is pulled down:
Decrease the red (R) value of all LEDs by 5
11. To program this project, a variable must be used to store the value of each of the LEDs. The variables
will start at zero (0) when the CyberPi starts and will be adjusted using the joystick or buttons.
12. Open the mBlock 5 software or mBlock 5 Web version. Add the CyberPi in the Devices tab and connect
in Live mode.
13. Go to the Variables section of the Block Area. Click the Make a Variable button.
14. Name the new variable redValue and leave For all sprites selected.
15. Introduce students to the following new blocks which are now available in the Variables section:
© education.makeblock.com 42
greater than the second value.
Returns TRUE or FALSE.
16. Instruct students to build the following scripts and test the program to observe the joystick up/down
controls increasing the red value of all of the LEDs:
Note, students can also add a block to set the brightness to 100% when the program starts.
18. Explain to the students how the conditional statements do not allow the redValue to ever be greater
than 255 or less than 0.
Try It
[20 minutes]
© education.makeblock.com 43
2. Students may find it helpful to add the following script inside the forever loop to see the values of the
variables on the CyberPi display:
Wrap‐Up
[5 minutes]
Variable Review
2. Discuss with students how variables are used to store information in a variety of computing devices
and applications. Discuss the following examples with students:
© education.makeblock.com 44
Fitness trackers stores the number of steps.
Automobiles (with a digital display) stores the number of miles driven.
Mobile devices stores the battery level and reports it as a percentage.
Store shopping cards store the number of visits until you earn a reward.
Video games store health, lives and scores.
Lesson Extension(s)
Have students add a title and instructions to the project.
Have students create a variable for the LEDNumber and use the middle joystick button to control
which LED is being changed.
© education.makeblock.com 45
Lesson 8
Strength Meter
Objectives
Overview
In this lesson, students will create a fun game with the CyberPi where the player shakes the CyberPi for ten
seconds. The students will program the game to keep score of how many times the shaking strength is greater
than 50.
Key Focus
Keeping score
Using the CyberPi Timer
Displaying text on the CyberPi display
Pre‐lesson Checklist
© education.makeblock.com 46
Computer with mBlock 5 installed or mBlock Web version
CyberPi with USB‐C cable
Pocket Shield (optional)
Example program(s): CyberPi – Lesson 8 – Strength Meter
Content Standards
Duration Content
Warm‐up
5 minutes
Variable Review
Hands‐on
15 minutes Detecting Strength
Keeping Score
Try It
20 minutes
Creating Strength Meter 2.0
Wrap‐up
5 minutes Motion Sensing
Lesson Extension(s)
© education.makeblock.com 47
Activities
Warm‐Up
[5 minutes]
Variable Review
30. Review variables with the class and explain how variables can be used to keep track of a score in an
mBlock project. Review with students how to create a variable, set a variable and change a variable in
mBlock.
Hands‐On
[15 minutes]
Detecting Strength
1. Review the following challenge and pseudocode with the students:
Project Create a game where the user shakes the CyberPi for 10 seconds and
Description earns a point for every time the shaking strength exceeds 50.
2. Open the mBlock 5 software or mBlock 5 Web version. Add the CyberPi in the Devices tab and connect
in Live mode.
© education.makeblock.com 48
Category Block Function
Loop Statement
Execute the actions nested inside
the block until a condition is
TRUE.
4. Instruct students to build the following scripts and test the program to observe the shaking strength
values:
Keeping Score
5. Make a variable named score and leave For all sprites selected.
© education.makeblock.com 49
6. Instruct students to add the following scripts to the program:
7. Now that the CyberPi is keeping track of the score, add the following scripts to display the score on the
screen with button A is pressed:
8. Have students play the game and see how many points they can earn.
Try It
[20 minutes]
© education.makeblock.com 50
3. Have students create the Strength Meter 2.0 using their pseudocode as a guide.
Wrap‐Up
[5 minutes]
Motion Sensing
3. The CyberPi has a 3‐axis gyroscope and a 3‐axis accelerometer which detects motion, acceleration and
vibration. The shaking strength block uses this component to determine how strong the CyberPi is
being shaken. Have students brainstorm a list of devices they use that use a gyroscope. Some examples
may include:
Mobile phones change the screen orientation based on device rotation.
Screens on mobile phones light up when the device is picked up.
Video game controllers detect motion.
Robotic vacuums detect if they have fallen or tipped over.
Lesson Extension(s)
Have students program the LEDs to progressively light up based on the strength (see example).
Have students program a 2‐player game where it tracks a score for both players, compares the
scores and declares a winner.
© education.makeblock.com 51
Lesson 9
Gift Alarm
Objectives
Overview
Students will use the CyberPi to create a program which detects whether or not a friend has shaken their birthday
present. Through the use of wireless communication, students will send messages between computing devices,
allowing one device to control another.
Key Focus
Pre‐lesson Checklist
© education.makeblock.com 52
Computer with mBlock 5 installed or mBlock Web version
Two (2) CyberPi’s with USB‐C cable or One (1) CyberPi and One (1) Halocode
Pocket Shield (optional)
Example program(s): CyberPi – Lesson 9 – Gift Alarm
Content Standards
Duration Content
Warm‐up
5 minutes
Internet of Things
Hands‐on
15 minutes
Wireless Communication in mBlock
Try It
20 minutes
Creating a Gift Alarm
Wrap‐up
5 minutes Brainstorming Ideas
Lesson Extension(s)
© education.makeblock.com 53
Activities
Warm‐Up
[5 minutes]
Internet of Things
31. Facilitate a short research activity on the Internet of Things. Have students research and present their
findings. Their research should lead them to learn more about how internet‐connected physical
computing devices are used in the following applications:
a. Smart Homes e. Weather
b. Healthcare Monitoring f. Manufacturing
c. Transportation g. Environmental Research
d. Agriculture h. Military
Hands‐On
[15 minutes]
Wi‐Fi
Using a Wi‐Fi connection, data is shared with the cloud message function. You can share data
across devices and projects with the same mBlock 5 account. Physical proximity or distance is
no longer a restriction, as these devices do not need to be in the same location.
To use, each device must be connected to the internet. See the blocks below for connecting the
CyberPi, Halocode and the mBlock project to cloud messages.
© education.makeblock.com 54
when a specific cloud broadcast is
received.
The CyberPi can communicate with a Halocode or an mBlock sprite through Wi‐Fi cloud
broadcast.
Halocode
Sprite
See description of CyberPi blocks
above.
LAN
A LAN (local‐area network) is a network that links a group of computers or devices within a
certain location. The group of computers share communications to send messages to each
other. A local area network can be formed between CyberPi’s to allow one CyberPi to control
another.
10. Select the type of communication that will work for with your classroom and students. Use the
following steps as an example of how wireless communication works in mBlock.
© education.makeblock.com 55
11. Open the mBlock 5 software or mBlock 5 Web version. Add the CyberPi in the
Devices tab and connect in Upload mode.
12. On the Panda sprite, in the Block Area, click the button. Find the
User cloud message extension and click +Add.
13. Instruct students to build the following scripts:
CyberPi Sprite
14. Update the Wi‐Fi ssid and password with the information for the wireless router in your location for
the CyberPi to connect.
15. Upload the program to the CyberPi and
test the program. Students should
observe Panda walk when the CyberPi is
shaken.
16. If the program does not appear to work,
add the following code to the CyberPi
script to troubleshoot the Wi‐Fi
connection.
Try It
[20 minutes]
© education.makeblock.com 56
1. Using the following problem statement, instruct students to plan a solution to the problem. There are
many ways to solve this problem; one sample solution has been provided for you.
Gift Alarm
How can mBlock, the CyberPi and/or the Halocode help you
determine if your friend shakes the present you give them this year?
2. Have students write pseudocode for the Gift Alarm and then create the project using their pseudocode
as a guide.
Wrap‐Up
[5 minutes]
Brainstorming Ideas
© education.makeblock.com 57
4. Wireless communication and cloud messages eliminate barriers such as cord length and device
location. With the class, brainstorm a list of ideas for programs that could benefit from wireless
communication. Some ideas may include:
Weather station which reports to a separate device.
Survey collection device in a main location of the school which reports results to the classroom.
Walkie talkie or text messaging between devices.
Lesson Extension(s)
Have students develop their own project using wireless communication.
Have students research networks and the role they in society.
© education.makeblock.com 58