You have been provided with an extended version of the previous code. You will now learn how to finish the code for an operation game that can detect 4 different object fails.
Click on the cog at the top right of CodeBug.
Tick the Show leg controls box.
Click Apply button.
Configure CodeBug’s legs 2 and 3 to be inputs.
Click the cog on your start block.
In the window that appears, tick the checkboxes next to leg 2 input/output and leg 3 input/output.
Click the cog again to close the window.
We want to set legs 0, 1, 2 and 3 to inputs, click the drop down menus on the start block so you have all the legs set to digital input.
You can see the code provided has two if blocks with scrolling text inside. You need to make another two if blocks in just the same way. Put them below the first two if blocks. Make sure you change the leg numbers to 2 and 3. Change the message that is scrolled for each of your new if blocks.
Click the Play button to run your code. A message will scroll when the corresponding leg is clicked.
Click the Download button to download your program.