Codey Rocky Coding Guide - EN
Codey Rocky Coding Guide - EN
Codey Rocky Coding Guide - EN
Codey Rocky
mBlock
www.makeblock.com
Contents
01 用按钮切换小程的表情
Change Codey's Emotions
with Buttons
08
Design a Controller for
Codey Rocky
Rocky
A Tour of the Interface
Menu Switch languages (CH/EN), Open files, Save files, Example programs, Help, etc.
iPad
1.Open mBlock 5. Connect Codey to your computer using the USB cable.
(The on-screen instructions will tell you how to do when you are
connecting Codey to the mBlock app.)
-2-
2. Powering on:Press the power button to turn on Codey.
Select
the serial
port
number
and click
Connect.
-3-
Quick Start
-4-
Create a Stage Project
Below the stage area, click Sprites and click + to add a sprite you like.
(The panda is the default stage sprite.)
If you want to delete a sprite, just click ‘’×’’ in the upper right corner of the
sprite or right click the sprite icon to select delete.
OR
Make the sprite move. Drag the move 10 steps block to the script area.
Click on the block to check how the sprite moves exactly.
-5-
3 Give the sprite a sound effect and add an
event block. Combine the two blocks with the
move 10 steps block. Ok, now you've
completed the program for your sprite!
4 Remember to save your program! Click "Save as" under the Menu to
save your program to local.
3
2
-6-
Change Codey's
Emotions with Buttons
Codey
tures
Explore more fea
Codey
1 Add an image
Drag the show image for 1 sec block to the script area.
Toolbar
3 Add a loop
Drag the repeat 10 times block to the script area
and use it to encircle other blocks.
Challenge
Codey
1 Add a note
Drag the play note C3 for (0.25) beats block to the script area.
Repeat the step to set different notes and snap the blocks together.
2 Add an event
Attach the when button A is pressed block to the top of the code.
Tip
Gear potentiometer
Gear potentiometer is an input device
that can be used to adjust values.
Using the gear potentiometer, you
can change the volume of Codey and
the brightness of the indicator light.
6 Add an event
Drag the when Codey starts up block to the top of the group
of blocks you've designed in the step 5.
Challenge
Codey
Toolbar
Select an image
3
Add an event
Drag the when Codey starts up block from the Events
category and add it to the code.
Upload
your program to
Codey to test it. Can you
notice? I'm blinking eyes at
varied intervals!
Have a Try
Challenge
Codey Rocky
1 Add a sensor
Drag the color is red block to the script area.
5 Add an event
Add the when Codey starts up block to your code.
6 Add a loop
Drag out the forever block and use it to encircle the code like this:
Now
Codey Rocky should
be able to identify two
colors. So why wait? Upload
the code to test whether
it works!
Have a Try
Challenge
Codey Rocky
1 Add an image
Drag the show image block to the script area.
2 Add a motion
Find the move forward at power 50% block in the Action category.
Then add it to the show image block.
3 Add a sensor
Drag the obstacles ahead? block to any blank space of the script area.
7 Add an event
Add the when Codey starts up block to your code.
Have a Try
Codey
2 Add an event
Combine the when button A pressed block with the
broadcast block like this.
3 Add a sprite
Click Sprites under the stage to add the sprite drum.
Tip
Each device or sprite has
its specific script area.
4 Add a sound effect
Drag the play sound high tom block to the script area.
5 Add a costume
Add the switch costume to drum-a block.
8 Add an event
Drag the when I receive A block to the top of the code.
Make sure your code looks like this.
Challenge
Codey Rocky
1 Add a sprite
Select the sprite arrow1 from Sprites under the stage.
3 Add an Event
Add the when this sprite clicked block to the broadcast block.
Repeat the steps above to add four arrows indicating different
directions. You can click Costumes to change the direction.
Tip
Each device or sprite has its specific script
area, so you'll need to make sure you place
the three groups of blocks above in the
correct script area.
4 Add a motion
Click Devices under the stage. Then drag the move forward at
power 50% for 1 sec block to the script area.
5 Add an event
Use the when I receive up block in your code.
Finish the code for the rest arrows as you did in the step 4 and step 5.
Challenge
Codey Rocky
Create
1 Create a variable
Click the Variables category and click Create variable. Name your
variable as number and then click OK.
2 Add a value
Drag the set number to 0 block to the script area.
5 Add an event
Add the when Codey starts up block to the code.
Challenge