Download presentation
Presentation is loading. Please wait.
Published bySpencer Snow Modified over 9 years ago
1
Bug Session Three
2
Session description In this session, pupils will discover how the Bug software makes drawing shapes easier (this is based on the use of variables to draw lines that they used in session two). They will be introduced to the idea of selection by using 'if' … 'then' … 'else' programming blocks. They will use this to help them play a ‘Battle Bug’ game. Objectives The students will: Revise the use of repeat loops Use an algorithm to plan a sequence which includes choice of actions Use 'if' programming blocks Use different methods to control the display of LEDs Session activities summary Use images to create letters and shapes (and consider how the images are programmed to appear) Use repeat loops to make images flash on and off Use A and B sensors to display Y and N as yes and no in ‘Battle Bug’ game Resources Bug website Bug software Battle Bug worksheets Bug Bug cables Bug: Session Three 1
3
Activities In session 2 we saw how we could use a variable to create lines on our Bug. The Bug software uses this to help you easily create images which can save you a lot of time programming each LED. Show pupils the ‘make image’ block in the Images menu. Challenge: Create a flashing image program What is your algorithm for a flashing image? Which programming blocks will you use to keep your image flashing on and off? 1.Turn on LEDs in the image 2.Turn off the LEDs 3.Keep repeating this Show them how it fits in the 'show image’ block. Time 5 minutes 10 minutes 2
4
Bug: Session Three 3 Pupils may need guidance to change from the image with coordinates ticked to the empty image. You have told your image how many times to keep flashing. We can keep it flashing ‘forever’. Demonstrate the use of ‘repeat while’ and 'true' block: Change your repeat loop to ‘repeat while’ from Loop menu. Add a ‘true’ block from the Logic menu. It will stay 'true' until someone tells it that it is false. 10 minutes
5
Bug: Session Three 4 What happens if you use the drop down arrow next to 'true' to change it to 'false'? The Bug will stop flashing. (This can be downloaded to your Bug to have a flashing badge.) Play ‘Bug Battle’ If pupils did not get a chance to do this in Session 1. 10 minutes
6
Bug: Session Three Rather than tell your partner out loud whether they have lit up your LEDs, you are going to get your Bug to tell them. When your partner is correct, your Bug will show a 'Y'. When they are incorrect, your Bug will show an 'N'. We will use your Bug’s ears (A and B) to tell it to show a 'Y' or an 'N'. What will the algorithm be? Ask pupils to record this on a white board or piece of paper. If I press 'A' light up a 'Y' If I press 'B' light up an 'N' How does your Bug know whether an LED should be lit up or not? It has a '1' for ON and a '0' for OFF. From Logic menu From Input menu From If menu The Bug will need to keep checking whether you have pressed A or B so we will need to use the ‘repeat while true’ blocks. 10 minutes 5 Top tip: Use concrete examples of if... do...else to help establish understanding e.g. use instructions for crossing a road.
7
Bug: Session Three You will need to tell it what to do if you press B. 6 Download to your Bug Play ‘Bug Battle’ Using your Bug to tell your friend whether their guesses and correct or incorrect. Did you know? There is a Bitesize KS3 guide called: Selection in Programming http://www.bbc.co.uk/education/guides/z2p9kqt/revision http://www.bbc.co.uk/education/guides/z2p9kqt/revision 5 minutes 10 minutes
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.