Skip to main content

junkbots 3 - bring it all together

Junkbots session 3: Move the robot but now there are rocks in the way.

 This is the last of three posts

- Introduction and sequence

- Loops and just having fun

- This one: Making decisions and bringing it all together.


What is the Junkbots project

The Junkbots project has been running for a number of years as an initiative to bring sustainability, computing and engineering together by building bots out of junk; details of the project can be found at. https://junkbots.blogspot.com/ . Junkbots is an extension of the Research into the teaching problem-solving going on at the University of Northampton please feel to visit https://computingnorthampton.blogspot.com/2019/01/problem-solving-research-outputs-and.html for more details.

 

What are we going to do?

·       Play with a Scratch robot on the screen!

·       Build on the routines from the previous session.

·       Look at example of what happens when the junkbot and the rock met. 

M      Making decisions


·       Adding key press to control the code to guide the junkbot around.

·       Extend your solution


 

Activity 1: Reminder of the blocks we used previously? https://computingnorthampton.blogspot.com/2020/05/junkbots-school-outreach-1.html


This means when the green flag is pressed do whatever follows.

 

 

 


This means place our robot (go to block) to point on the screen roughly in the centre of the screen.

 

Do you want a challenge: What do think would happen if instead 0 and 0 in the white spaces in the go to block, we put in 50 and 50? Have a guess.

 

 

 

This means stop the scratch program for 1 second and then carry on.

 

 

 

We can use this block to move the robot 50 steps on the screen in the direction it is facing.

 



We can use this block to turn the robot to the right 45 degrees.

 


We are also going to look at two more ‘things’ today: one new block and a new type of blocks to make our programming easier – the control blocks.

 

 


We can use this block to change the direction the robot faces.

 

 


When we click on the control button at the side we see several more blocks we can use.

 

One of these we have played with before the wait block.

 

The other two we are going to use today in later activities.

 

When we want to repeat a combination of blocks so many times, we can use the middle block and then change the 10 to the number of times we want to repeat.

 

If we want it repeat something forever (or until we stop the program with the red button) we can use the last block.

 

 



Sometimes we want to change what the program does when something happens.

 

We will look at three types of instructions

-     If this ‘thing’ happens then do this.

-     If this ‘thing’ happens then do this else to this other thing

-     When a key is pressed do this.

 

  

 


Activity 2: Have a go at guessing what it is going to do?

 

Follow this link to a new Scratch project https://scratch.mit.edu/projects/405642711

 

 

Challenge 1: Press the green flag and see what it does.  THEN press the green flag and see what it does.

Tell others what you saw it do?

 

Challenge 2: Now go in the Scratch code for the rock (it should look like the scratch program shown next to this).

- describe what you think this does?

- tell others why do you think the if block is inside a forever block?

 

 

 

 

Activity 3: Modify and Make

 

·       Staying with the same scratch code you might have noticed that the junkbot doesn’t always hit the rock.

·       We are going change this so we can guide the junkbot to hit the rocks.

·       Go to the code for the junkbot/robot/rcx.

·       Challenge 3: Add instructions to move the junkbot by pressing the arrow keys. In the picture you can see two events blocks one group of blocks says what happens when the up key is pressed then other when the right key is pressed.

·       Add blocks to make the down and left keys move the junkbot down or left.

 

 

 

 

 

 


 

 

 

 

 

Activity 4: Modify and make play

 

·       Lets get it to add more blocks either using the program you have developed or https://scratch.mit.edu/projects/405650433

·       Go to the stage code you will see a block saying create clone of Rocks every time this block is used a new rock is added to the screen.

·       Challenge 4: Can you change the code so 20 rocks are put on the screen and now create a game where you have to hit every rock.

·       Challenge 5 – looking at other scratch examples (for example https://projects.raspberrypi.org/en/projects/ghostbusters/4) could you add a scoring system to this game.

 

 

 

 

 

 All three activities are available on Issu.com




All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with. Twitter: @scottturneruon

If you would like to know more about the Junkbots project contact scott.turner@northampton.ac.uk

Comments

Popular posts from this blog

Junkbot Raspberry Pi: 3 How to do it

Figure 1 In previous posts I start looked at using ScratchGPIO to control a junkbot  ( http://junkbots.blogspot.com/2014/08/junkbot-pi-1-scratchgpio.html ) and showed a Pi controlled junkbot briefly in action ( http://junkbots.blogspot.co.uk/2014/08/junkbot-raspberry-pi-2-raspberry-pi.html ). In this post I aim to discuss - Choice of motor controller card - Provide an example of a drawing junkbot controlled through Scratch and Raspberrry Pi Choice of interface/Controller card The card choosen was the 4Tronix PiRoCon card  ( http://4tronix.co.uk/store/index.php?rt=product/product&product_id=182 ). Selected for four reasons - Price is reasonable (in my opinion). - Fits straight onto the Pi through the GPIO - no extra cables needed. - ScratchGPIO has it as an addon so it makes programming it even easier (see http://cymplecy.wordpress.com/2013/10/31/pirocon-from-4tronix/ ). - Others are using it for robot projects. Use it is quite easy plug the board directl...

Brooke Weston Event

Students at Brooke Weston School, Corby have been working with the University of Northampton's School of Science and Technology on the junkbots project. Scott Turner and Terry Tudor on the 16th and 17th February 2010 went to the school to run the sessions. Starting with a talk and activities on waste management, including how much waste the UK produced, and in terms of numbers of slices of toast what is the cost of energy of leaving a monitor on overnight.   The task was to produce robots out of rubbish that could carry other rubbish into a containment area. The change made to the sessions was that students brought there own 'junk' to the sessions. S ome innovative and creative designs were produced involving 'legs', wheels (including turning cans into wheels and wheels from old toys).    Some of the designs pushed rubbish into the area, but one of the designs carried the rubbish into the area and some designs used magnets to pick up small steel parts (nuts a...