background image

Code for Fun with 

Codey Rocky

www.makeblock.com

mBlock

Summary of Contents for Codey Rocky

Page 1: ...Code for Fun with Codey Rocky www makeblock com mBlock...

Page 2: ...y into a Musician Make Codey Blink Eyes Make Codey Blink Eyes Make Codey Rocky Identify Colors Make Codey Rocky Identify Colors Make Codey Rocky Avoid Obstacles Make Codey Rocky Avoid Obstacles Use Co...

Page 3: ...including sound sensor light sensor LED screen and more And with just a few lines of code you can easily make Codey Rocky do all kinds of amazing things like playing music chasing lights or changing f...

Page 4: ...rounds here Switch languages CH EN Open files Save files Example programs Help etc In this area you are able to find the blocks you ll need by category or color This is the place where you drag blocks...

Page 5: ...d click Connect Scan the QR code on the left side to check out the demo Note The COM3 here refers to the serial port number and it may vary due to different systems or computers Anyway you can just cl...

Page 6: ...each other Now you need to drag out the when Codey is shaking block and combine it with the play sound block Here is what your code should look like How to delete the program Drag the program back to...

Page 7: ...panda is the default stage sprite 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 If you want to delete a sprite just cli...

Page 8: ...e bat will move 10 steps forward and play the sound pop To pause the program click on Remember to save your program Click Save as under the Menu to save your program to local 3 4 Give the sprite a sou...

Page 9: ...Scan the QR code to view the demo Codey Change Codey s Emotions with Buttons Change Codey s Emotions with Buttons...

Page 10: ...nother sound You can edit the image Drag the play sound block to the script area In the Display category you can find the show image block Drag the block to the script area and add it to the end of th...

Page 11: ...ad the code to test whether it can work as expected Explore more features Try adding the following programs to Codey Rocky as you just did 3Add an event Add the when button A is pressed block to the p...

Page 12: ...Upload the code to Codey Rocky Then try pressing the button A B and C Remember to save your programs Have a Try Have a Try...

Page 13: ...Can you use the three buttons to let Codey Rocky show more emotions or make different sounds Challenge Challenge...

Page 14: ...ifferent images So the mission of this booklet is to teach you how to animate those images Scan the QR code to view the demo Use Codey to create LED animations Use Codey to create LED animations Scan...

Page 15: ...show image for 1 sec block to the script area You can reset the time Click here to draw an image Use the toolbar to refine or save the image Repeat the steps above to give the rabbit different motion...

Page 16: ...sound effect Add the play sound block to the code 3 Add a loop Drag the repeat 10 times block to the script area and use it to encircle other blocks You can pick another sound effect You can reset th...

Page 17: ...from the Events category and add it to the code You ve completed the code for making an LED animation Now you ll need to upload the code to Codey Rocky Then try shaking it Or you can tie Codey to you...

Page 18: ...Can you create your own LED animations by drawing some different images Give it a try Remember to save the program Challenge Challenge Have a Try Have a Try...

Page 19: ...Codey Turn Codey into a Musician Turn Codey into a Musician Scan the QR code to view the demo...

Page 20: ...what music Codey is playing 1 1 Add a note Drag the play note C3 for 0 25 beats block to the script area You can reset the beat Click here to select a note 2Add an event Attach the when button A is pr...

Page 21: ...block and put it inside the set volume block 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...

Page 22: ...m to Codey Try changing the volume of the music 2 5Add a loop Encircle the set volume and gear potentiometer blocks with the forever block 6Add an event Drag the when Codey starts up block to the top...

Page 23: ...give Codey more sound effects or make Codey show light effects while playing music Upload the program and press the button on Codey Wait Remember to save your program Have a Try Have a Try Challenge C...

Page 24: ...Codey Scan the QR code to view the demo Make Codey Blink Eyes Make Codey Blink Eyes...

Page 25: ...on Drag the show image for 1 sec block to the script area You can reset the time Click here to select or draw an image Use the toolbar to revise and save the image Repeat the steps above to add differ...

Page 26: ...o encircle the code 3 Add an event Drag the when Codey starts up block from the Events category and add it to the code Ok you ve finished the program for making Codey blink eyes Try uploading the prog...

Page 27: ...e pick random 1 to 10 block Put the block inside the show image for 0 2 secs block You can change the random numbers Note You can t directly join these round blocks to other blocks Upload your program...

Page 28: ...Can you make Codey show different facial expressions Remember to save your program Have a Try Have a Try Challenge Challenge...

Page 29: ...Make Codey Rocky Identify Colors Make Codey Rocky Identify Colors CodeyRocky Scan the QR code to view the demo...

Page 30: ...hen block to the script area and put the color is red block inside that hexagonal hole 3Add a light effect Drag the RGB LED lights up block into the if then block You can reset the color You can click...

Page 31: ...en Codey starts up block to your code Ok you ve finished the code for enabling Codey Rocky to identify red items Now upload the code to Codey and place a red item before Codey Rocky See how it reacts...

Page 32: ...the forever block and use it to encircle the code like this Repeat the steps 1 4 to make your code look like this Now Codey Rocky should be able to identify two colors So why wait Upload the code to t...

Page 33: ...you keep the IR sensor face down Try using different colored materials to make items for Codey Rocky to identify And revise the code to have Codey Rocky show different reactions Have a Try Have a Try...

Page 34: ...Make Codey Rocky Avoid Obstacles Make Codey Rocky Avoid Obstacles CodeyRocky Scan the QR code to view the demo...

Page 35: ...a motion Find the move forward at power 50 block in the Action category Then add it to the show image block 3Add a sensor Drag the obstacles ahead block to any blank space of the script area Note Hex...

Page 36: ...Drag the wait until block to the script area and put the obstacles ahead block inside the hexagonal hole Then join the two pieces of blocks like this 5Make Codey Rocky stop moving Add the stop motion...

Page 37: ...works Then try placing an item in front of the robot What happens 6Add motions First add the move backward at power 50 for 1 sec block to the code and then add the turn right at power 50 for 1 sec blo...

Page 38: ...Now Codey Rocky is able to stay away from obstacles whenever it meets them 8Add a loop Encircle your code with the forever block as shown below...

Page 39: ...Look Codey Rocky is able to avoid the obstacles Important You should keep the IR sensor face forward Have a Try Have a Try...

Page 40: ...Try using the block in your code to make Codey Rocky stay away from cliffs Make sure you make the IR sensor face down Challenge Challenge...

Page 41: ...Use Codey to Make Sprites Play Instruments Use Codey to Make Sprites Play Instruments Codey Scan the QR code to view the demo...

Page 42: ...ry to the script area 2Add an event Combine the when button A pressed block with the broadcast block like this 3Add a sprite Click Sprites under the stage to add the sprite drum You can create a new m...

Page 43: ...ct Drag the play sound high tom block to the script area 5Add a costume Add the switch costume to drum a block 6Add a control block Add the wait 1 sec block to the code in the following way You can ch...

Page 44: ...8Add an event Drag the when I receive A block to the top of the code Make sure your code looks like this Add the switch costume to drum a block Ok the code is ready Now upload it to Codey Rocky to tes...

Page 45: ...Have a Try Have a Try Challenge Challenge Can you add more sprites to form a band Press the button Let s hear the drum sound...

Page 46: ...Design a Controller for Codey Rocky Design a Controller for Codey Rocky CodeyRocky Scan the QR code to view the demo...

Page 47: ...w1 from Sprites under the stage 2 Add the broadcast Drag the broadcast message block to the script area of the arrow1 3Add an Event Add the when this sprite clicked block to the broadcast block You ca...

Page 48: ...rows indicating different directions You can click Costumes to change the direction Each device or sprite has its specific script area so you ll need to make sure you place the three groups of blocks...

Page 49: ...motion Click Devices under the stage Then drag the move forward at power 50 for 1 sec block to the script area 5Add an event Use the when I receive up block in your code Finish the code for the rest a...

Page 50: ...adding some other icons to empower the controller with more abilities like sound control or facial expressions control Click the arrows to check how Codey Rocky reacts Challenge Challenge Have a Try...

Page 51: ...Make a Number Bomb Game Make a Number Bomb Game CodeyRocky...

Page 52: ...nd click Create variable Name your variable as number and then click OK 2Add a value Drag the set number to 0 block to the script area 3Add the display block Click the Display category to add the show...

Page 53: ...Variables category Drag it into the show hello until done block Your code should look like this 5Add an event Add the when Codey starts up block to the code 6Add the value Drag the change number by 1...

Page 54: ...7Add a sound effect Drag the play sound hello block from the Speaker category and add it to the code you ve just created Repeat Step 3 and Step 4 You can reset the sound effect...

Page 55: ...8Add an event Add the when button A is pressed block to the code you ve finished in Step 7 Ok the code is ready Now upload it to Codey Rocky turning the robot into a timer...

Page 56: ...Level up Make a number bomb game to challenge your friends Two players take turns pressing the button A At the same time the number is growing The one that triggers the bomb will lose the game...

Page 57: ...Invite your friends to play the game Revise the code above Make sure the game will start over when the button C is pressed Have a Try Have a Try Challenge Challenge...

Reviews: