/
SCRATCH BUILDER SCRATCH BUILDER

SCRATCH BUILDER - PDF document

elena
elena . @elena
Follow
345 views
Uploaded On 2021-08-14

SCRATCH BUILDER - PPT Presentation

RQ ROBOT CODING GUIDEWWWROBOBUILDERNETScratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab See httpscratchmitedu11 How to install ScratchScrx0005tch x0005nd Scrx0005tch Muild ID: 863138

scratch x0005 sound builder x0005 scratch builder sound block huno robot sensor select blocks led blocf x0004 clicf stand

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "SCRATCH BUILDER" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1 SCRATCH BUILDER RQ ROBOT CODING GUIDE WW
SCRATCH BUILDER RQ ROBOT CODING GUIDE WWW.ROBOBUILDER.NET Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. See http://scratch.mit.edu1 1. How to install Scratch Scrtch nd Scrtch Muilder need to be instlled in the user’s computer to control RQ robots with Scratch. �Scratch?: Coding program made by MIT Medial Lab. �Scratch Builder?: Program that helps connecting the robot and Scratch.

2 1) Go to the Scratch website ( www.scrat
1) Go to the Scratch website ( www.scratch.mit.edu/ ) 2) Move down to the bottom of the website 3) Select Offline Editor from Support . SCRATCH BUILDER 2 01 INSTRALLATION AND SET - UP 4) Install Adobe AIR and Scratch Offline Editor in order. ① ② SCRATCH BUILDER 3 Scratch has been installed. Shall we install the next program? 2. How to install Scratch Builder 1) Go to the Robobuilder website ( www.robobuilder.net ). 2) Select SOFTWARE under SUPPORT

3 S. 3) Download the Scratch Builder softw
S. 3) Download the Scratch Builder software from SOFTWARE and install. 4) Run ‘Setup.exe’ file. (If this messge “User ccount Control - Do you want to allow this app from an unfnown publisher to mfe chnges to your device?” ppers, clicf Yes to continue with the installation). 5) Select ‘English’ 6) Clicf ‘Next’. SCRATCH BUILDER 4 SCRATCH BUILDER 5 7) On License greement, clicf ‘I 

4 gree’. 8) Checf the destintion
gree’. 8) Checf the destintion folder nd clicf ‘Instll’. 9) When RQ - USM2URT Sriver ppers during instlltion, clicf ‘Next’. SCRATCH BUILDER 6 10) On License Agreement (RQ - USB2UART Drive - relted), Checf ‘I ccept…’ nd clicf ‘Next’. 11) Once the RQ - USM2URT Sriver Instlltion hs been completed, Clicf ‘Finish’. Continue

5 with remaining Scratch Builder installa
with remaining Scratch Builder installation. 12) Scrtch Muilder hs been instlled. Clicf ‘Finish’. SCRATCH BUILDER 7 13) The Scratch Builder screen opens. The program has been installed. Now, let’s lern how to connect the robot with the computer! 3. How to connect the USB2UART cable when directly connecting to RQ controller. To have Scratch communication with the RQ robot, it needs to be connected with the communicati

6 on cable (RQ - USB2UART). (If it does no
on cable (RQ - USB2UART). (If it does not work even when the communication cable is normal, try reinstalling the driver for the communication cable). 1) Connect the RQ - USB2UART to the laptop (PC). 2) Connect the yellow connector of the cable to the yellow port (Communication port) on the back of RQC (RQ controller). 3) Checf tht the bttery’s power cble is connected nd turn on the RQC power switch. SCRATCH BUILDER Well done!

7 Let’s find out about another way to
Let’s find out about another way to connect! 8 SCRATCH BUILDER 9 4. How to connect the USB2UART cable when using a Bluetooth chip 1) Connect the Blutooth / RF socket to the yellow port on the RQC. 2) Insert a Bluetooth chip to the socket. 3) Checf tht the bttery’s power cble is connected and turn on the RQC power switch. 4) Go to Bluetooth device manager in your PC. Click Add Bluetooth or other devices and choose RBT1111XXXX

8 (Password is 1234 or 0000). 5) Run Scrat
(Password is 1234 or 0000). 5) Run Scratch Builder software and select the Comport where the Bluetooth is connected, nd clicf ‘Connect’ to mfe  connection. *If the connection fails, turn off and on the RQC and retry. SCRATCH BUILDER 10 1. Open Scratch Builder When you are ready with the RQ robot to control with Scratch, open Scratch Builder. 1) Open Scratch Builder on the desktop screen. 2) Select ‘Connect’ to mfe �

9 05; connection for communiction.
05; connection for communiction. 3) Select ‘uto Connect’ for utomtic connection. Once the connection has been established, the Connect icon turns green. 02 UNDERSTANDING SCRATCH BUILDER SCRATCH BUILDER 11 4) Select ‘New Scrtch’ 5) Clicf ‘New’ on the Left to crete  new file. Choose  robot pltform nd enter a file name. When creating a new file. Select a robot platform bet

10 ween the 3 choices. RQ Robot covers all
ween the 3 choices. RQ Robot covers all RQ kit series from +110 to the end, and Non - standard is for models that user created. SCRATCH BUILDER 12 6) A Scratch file under the given name is created. Double click the file to run the Scratch software. 7) Clicf ‘More Mlocfs’ in purple on the Scrtch screen to show the exclusive blocfs for the RQ robot (Nothing shows on More Block when Scratch is opened without Scratch Builder). Now Scratch Builder

11 is opened, should we learn how to use
is opened, should we learn how to use Scratch? 2. Understanding the Scratch screen Let’s lern how to control the RQ robot with Scrtch. SCRATCH BUILDER 13 Language, Font size Code start and stop Duplicate, crop, size adjustment Block Palette: Divided into 10 block menus - correspond to different functions X, Y coordinates of the Sprite’s position Sprite that moves as coded Scripts area: The space to code with Scratch. Scripts: Br

12 ing block commands from the palette to
ing block commands from the palette to combine and use. Costumes: Draw, edit or open an image. Sounds: Open and use a sound file or record. Sprite block: - Shows the Sprite in unit. - Edit the Sprite. Combine various blocks from the palette to create a Scratch program. Adjust the block size in the script space. It looks complicated, but you will soon become familiar as you follow step by step. SCRATCH BUILDER 14 3. Basic Scratch blocks No. Color Item Fu

13 nction 1 Motion Move Scratch’s Sprite
nction 1 Motion Move Scratch’s Sprite in various ways (location change, angle, etc ). 2 Event Select how to start the Scratch. 3 Looks Change the shape, background, color, speech bubble and form of show and hide. 4 Control Control the block progress - run time, repetition (repetition time, infinite), condition, etc. 5 Sound Play sound from the PC and play various sounds. 6 Sensing Select various conditions. 7 Pen Select the method for erase, stamp (duplic

14 ate) and pen. 8 Operation Select operat
ate) and pen. 8 Operation Select operation - related matters like the four arithmetical operations, a sign of inequality, and logical operation. 9 Data Create variables and lists. 10 More blocks Special blocks to control the RQ robot. SCRATCH BUILDER 15 4. Using RQ robot control - related blocks (More Blocks) 1) Moving forward, backward, left, right and more movements. More block is a special block that is necessary for RQ robot control. Let’s le�

15 5;rn more bout More Blocks. C A
5;rn more bout More Blocks. C A D B Matches between the direction options on Scratch builder and the buttons on remote controller. (1) Call motions - Move forward - Move backward - Turn Left - Turn right SCRATCH BUILDER 16 Some robots move differently depending on its design, but for all robots, pressing the arrows make the motor rotate to move the robot. (2) Set wheels - Move forward - Move backward - Turn Left - Turn right SCRATCH BUILDER 17 T

16 he number inside the block is the speed
he number inside the block is the speed level. 1 means speed level 1, and 2 means speed level 2. SCRATCH BUILDER 18 CW stands for ‘clocfwise’ nd CCW, ‘counterclocfwise’. This block directly controls the motor’s rotation directions. (3) Rottion motor’s direction nd speed 2) LED (1) Turning on the LED (2) Turning off the LED Selecting the LED color Selecting the LED color Selecting the LED module SCRATCH BUILDER 19 Turn

17 ing on Red for LED1 Turning on Blue fo
ing on Red for LED1 Turning on Blue for LED1 Turning on Red and Blue for LED1 Turning on off LED1 Turning on Red for LED1 and 2 Turning on Blue for LED1 and 2 Turning on Red and Blue for LED1 and 2 Turning on off LED1 and 2 SCRATCH BUILDER 20 (3) Make the red LED and the blue LED blink 10 times in sequence. (4) Make the red and the blue LED blink 10 times at the same time. (5) Make the red LED and the Blue LED blink 10 times very quickly in seque

18 nce. (6) Make the red and the blue LED b
nce. (6) Make the red and the blue LED blink 10 times very quickly at the same time. A good combination of LED blocks and makes a great LED lighting. SCRATCH BUILDER 21 3) Using Melody (1) Turning on a melody (2) Turning off the sound Selecting a melody Selecting a scale Turn off the melody My favorite is Twinkle, Twinkle, Little Star. What is yours? (3) Turn on the melody ‘Twinfle , Twinkle, Little Str’. (4)

19 Play ‘Twinfle , Twinkle, Little Star
Play ‘Twinfle , Twinkle, Little Star for only 5 seconds’. (5) Play Do for 0.5 seconds. (6) Play Do, Re, Mi for 0.5 seconds. (7) Play Do, Re, Mi for 0.5 seconds (repeat 3 times) (8) Play Do, Re, Mi for 0.5 seconds each and pause1 second in between each note. SCRATCH BUILDER 22 It’s this esy to mfe the robot play sounds. Shall we make a nice song? SCRATCH BUILDER 23 5. Using RQ robot sensors Unlike other blocks, the sensor block n

20 eeds to be used together with another bl
eeds to be used together with another blocks with different conditions. 1) Sound sensor (1) If the sound sensor detects sound louder than 50, Move forward. (2) If the sound sensor detects sound louder than 50, play ‘Twinfle, Twinfle, Little Str’. (3) If the sound sensor detects sound louder t han 50, blink the red and the blue LED 10 times i n sequence. Example If the sound sensor detects sound louder than 50, SCRATCH BUILDER 24 2) Touch sens

21 or (1) If the touch sensor number 1 is
or (1) If the touch sensor number 1 is on , move forward (2) If the touch sensor number 1 is on , ply ‘Twinfle, Twinfle, Little Str’. Example If the touch sensor is on, If the touch sensor is off, Connect the touch sensor to number 1 and number 3 sensor port of the RQC (Smart controller). Choose between or SCRATCH BUILDER 25 3) IR Sensor (Infrared Sensor) (1) If the IR sensor detects a value greater than 150, move backward and then stop

22 . (2) If the IR sensor detects a value
. (2) If the IR sensor detects a value greater than 150, repeat blinking the red and blue LEDs quickly. Example If the IR sensor detects a value greater than 50, Connect the IR sensor to number 2 and number 4 sensor port of the RQC(Smart controller). Choose between or SCRATCH BUILDER 26 6. Uploading Scratch code Before the upload, RQ robot should be connected to the computer . See 1 - 3 ‘How to connect’. 1. Code using Scratch 2. Run the Scratch code to

23 check if it works correctly, and then c
check if it works correctly, and then click Save . 3. Save and then close Scratch. 4. On Scratch Builder, click Upload. SCRATCH BUILDER 27 5. Drag the file you have just saved to the bottom left, following the arrow. 6. Click ‘Of’ when upload pop - ups appears. 7. Once uploaded, the Upload successful message opens . Clicf ‘Of’. SCRATCH BUILDER 28 8. Remove the cable connected to the robot. 9. Direct a registered remote to the robot and press the stop

24 button. (When you push the button, the
button. (When you push the button, the ringing sound plays). 10. Direct registered remote to the robot and press #+4. 11. With the ringing sound, coding begins. 12. If you have coded an infinite loop, press #+Stop to end coding. (When the coding ends, it beeps). How to change the font size on Scratch 1) Hold the shift button on the keyboard and click the globe icon to open a hidden function (set font size). 2) Select the font size to 11 to make the font bigge

25 r. 3) Select the font size 11 or any num
r. 3) Select the font size 11 or any number that your prefer to make the font bigger. SCRATCH BUILDER 29 TIPS! Sometimes, the text inside the blocks are so small on the Scratch screen that it’s difficult to red. Let’s lern how to change the font size for texts inside the blocks. Learning objective Code to make RQ - HUNO stand up from its lying position. 1. Learn how to make RQ - HUNO stand up (Stand A , B). Standing up when facing th

26 e sky (Stand A) Standing up when facing
e sky (Stand A) Standing up when facing the floor (Stand B) Using Scrtch’s ‘More blocfs’ nd ‘Control’, let’s code to distinguish whether the robot is facing the sky or facing floor. *Stand A and B motions are some of the basic behaviors including in RQ - HUNO’s firmwre . 2. Learn how to make RQ - HUNO stand up when it hear a voice . SCRATCH BUILDER 30 03 PROGRAMMING PRACTICE: WAKING UP RQ - HUNO SCRATCH BUILDER 31 1. How

27 to make RQ - HUNO stand (A,B) 1) Select
to make RQ - HUNO stand (A,B) 1) Select ‘More blocfs’ to use specil blocfs to control RQ robots. 2) From different blocfs in the More blocfs, use ‘Cll motions’ to select ‘Mutton ’ (Stnd ). [List of Call motions] C A D B See that they represent the buttons on the remote. SCRATCH BUILDER 32 3) Srg nd drop ‘Cll motions’ blocf to the script re then select ‘Mutton

28 ’ from its drop down menu. 4
’ from its drop down menu. 4) Then use the ‘Wit ( ) secs’ blocf from ‘Control’ section. We need this blocf to secure enough time while ‘Mutton ’ (Stnd ) is in ction. 5) ‘Mutton ’ motion reyuires bout 2 seconds. Not to interrupt the next blocf, use ‘Wit ( ) secs’ blocf to secure enough time. 3 seconds re better thn 2 seconds for stbility. 6)

29 Put down RQ - HUNO as shown in the pictu
Put down RQ - HUNO as shown in the picture and click the Scratch block. RQ - HUNO then stands up from its lying position. Now that RQ - HUNO stood up. Let’s mfe it wlf. SCRATCH BUILDER 33 7) The block below will make RQ - HUNO stands up and takes a step forward. 8) Select ‘Repet’ blocf from ‘Control’ section, then plce it bove the ‘Cll motions button ↑’ block. Then change the time to 3. Let’s m

30 fe RQ - HUNO walk further! Letâ
fe RQ - HUNO walk further! Let’s run the code and see what happens. When the Scratch block is running, a yellow band forms around the blocks. When the yellow band is gone, it means the Scratch block motion has ended. TIPS! SCRATCH BUILDER 34 9) Put down RQ - HUNO as shown in the picture and click the Scratch block. RQ - HUNO stands up and takes 3 steps forward. 10) To play a melody while RQ - HUNO is in motion, let’s use ‘Sound on/ off’ b

31 locfs from ‘More blocfs’. 11) Put d
locfs from ‘More blocfs’. 11) Put down RQ - HUNO as shown in the picture and click the Scratch block. RQ - HUNO stands up and takes 3 steps and the melody plays. Once the motion has been completed, the melody also stops. This time, we are going to make a melody play while RQ – HUNO is in motion and stop when all motions are finished SCRATCH BUILDER 35 12) The Scratch blocks below is for making RQ - HUNO stand up when it falls face down (Stand B)

32 . 13) Put down RQ - HUNO (Facing down) a
. 13) Put down RQ - HUNO (Facing down) as shown in the picture and click the Scratch block. RQ - HUNO stands up and take 3 steps forward with playing the melody. Once the motion has been completed, the melody also stops. 2. How to make RQ - HUNO stand up when it hears a voice. 1) Let’s mfe Scrtch blocfs s shown in the picture below. Use the sme blocks from previous chapter. Use the same blocks we made from the chapter 1.

33 We add more lines to make RQ - HUNO hea
We add more lines to make RQ - HUNO hears a voice. Let’s find out how we cn use to detect a voice. SCRATCH BUILDER 36 2) Srg ‘Sound sensor’ blocf with the mouse to insert into . 3) Enter 50 s the bsic sound volume in the blnf. This mens ‘The vlue of detected sound is greter thn 50’. From ‘More Mlocfs’, checf , then

34 will appear on the top left stage. If t
will appear on the top left stage. If the robot’s power is on and the communication connection has been made properly, the volume of sound around the robot is displayed with a number. When using the sound detection function in Scratch, check the volume of sound measured before setting a basic value. For example, if the volume of sound measured is 60, set the basic value to 50 for stable sound detection. In other words, it is better to set the basic value

35 a slightly lower than the actual measure
a slightly lower than the actual measurement. For reference, the sensor values for the sensors other than Sound sensor block will not appear immediately. TIPS! SCRATCH BUILDER 37 4) Select ‘If then’ blocf from Control blocfs to mfe blocfs s below. It is the prt tht sys ‘If the vlue of sound mesured is greter thn 50, then execute XXXX.’ Drag the conditional phrase block to cover t

36 he block that you created already. 5) &#
he block that you created already. 5)  conditionl blocf life ‘if’ my not worf even blocfs hve been inserted into ‘if’ prt. This is becuse it only performs once nd then does not repet. Use ‘Forever’ blocf from Condition block section to repeat specific blocks infinitely. You can not detect sound only with . You will need a conditional block. Condition

37 Execution We use ‘Forever’ blocf wi
Execution We use ‘Forever’ blocf with ‘If’ block to detect sound at any time. SCRATCH BUILDER 38 6) Lstly, plce ‘Wit ( ) secs ’ blocf under ‘Sound off’ blocf, then put 1 second in the blnf 7) Put down RQ - HUNO as shown in the picture and click the Scratch block. When you click, it does not do nything. Mut when you shout, “Wfe up”., or clp to mfe some noise, RQ - HUNO stand

38 s up and take 2 steps forward with playi
s up and take 2 steps forward with playing the melody. 8) If you chnge ‘Cll motions blocf’ s below, RQ - HUNO will stand up and move 2 steps when RQ - HUNO lays face down. If there is no ‘Wit 1 secs’ blocf, the program starts from the beginning as soon as the sound is turned off with ‘Sound off’ blocf, then it cn detect the sound from robot moving. That is why it waits for one second after the sound is

39 turned off. Issued date: January 9 th ,
turned off. Issued date: January 9 th , 2018 Publisher: Robobuilder Co.,Ltd . Address: B - 611, DMC Hi - tech Industry Center, Seongam - ro 330, Mapo - gu , Seoul, Korea 03920 Tel: +82 - 2 - 3141 - 5101 E - mail: sales@robobuilder.net Web: www.robobuilder.net Copyright by Robobuilder Co.,Ltd . All rights reserved . No part of this publication may be reproduced or distributed in any form or by any means, without the prior written permission of the publis