Kitronik Craft & Code Single Pack - Booklet Answers

Have you answered the questions in the Craft & Code booklet? Check your answers below! We’ve sorted the answers into page numbers and hidden them - once you’re ready you can click on the question to reveal the answer!

Page 15

Q: What will happen if this program is run?

A: When the user touches the touchpad, the motor will turn on for 2000ms then turn off. If the touchpad is not pressed, the motor will stay off.

Q: How might you change the time on the pause block?

A: Changing the time on the pause block (ms) will change the length of time that the motor runs, therefore the amount of time the carousel spins. Using a smaller number, such as 500ms, the carousel will likely not make a full rotation. However, setting a larger number, such as 5000ms, will allow the carousel to rotate several times.

Page 16

Q: Can you use this block to affect the speed of the motor?

A: To do this, drop the ‘set motor speed’ block between the ‘turn motor on’ and ‘pause’ blocks. Select a speed from the dropdown box; the default speed will be ‘slow’. Once you change the speed, remember to download the revised program onto the micro:bit before testing.

Q: What does the angle mean?

A: The angle is the position of the servo arm in degrees. There are a number of arms that can be attached to the servo to gain different results. We used the single prong arm to create our barrier, which moves from 0 to 180 degrees.

Q: Why is there a pause?

A: The pause allows an action to be carried out before the code continues. In this case, the ‘passengers’ walk through the safety barrier before it closes. Imagine that passengers scan a ticket to get on, the barrier opens, they walk through and the barrier closes again.

Q: Why is there a forever block around the code?

A: A forever block allows the code to happen continuously rather than only once.

Page 17

Stretch Challenge: Creating a safety barrier.

Tape a small section of straw to the arm of your servo to act as a safety barrier. Then, amend your Carousel code as shown below.

Page 21

Q: What will happen if this program is run?

A: The Craft and Code board will wait until the touchpad is pressed. When the touchpad is pressed, the bulb will turn on, pause for 5000ms and then turn off.

Q: Why is there a forever block around the code?

A: A forever block allows the code to happen continuously rather than only once.

Q: What is the importance of the pause block?

A: The pause allows an action to be carried out before the code continues. In this case, the bulb will turn on, pause for 5000ms and then turn off. This allows the light to stay on for a specific amount of time.

Page 22

Q: Can you make the brightness of the light change?

A: Example Code:

Page 23

Q: Can you modify your code to be light-responsive?

A: The micro:bit has LEDs that can also work as a light sensor. The amount of light is measured from 0 to 255. You will need to use an ‘if… else’ block and a comparison block for this.

Troubleshooting:

  • Try making the number next to ‘light level’ smaller or larger to suit the light where you are.
  • Check that your < > symbol is correct.
  • Double check your code.

Leave a comment

All comments are moderated before being published