This program uses the micro:bit’s accelerometer to guide the pencil sprite around the screen, drawing a line as it moves. Tilting the micro:bit left or right makes the pen to move left or right in the X-axis, across the screen. Tilting the micro:bit forwards and backwards makes the pen move up and down, in the Y-axis. If you tilt it diagonally you get diagonal lines. You can control the thickness of the pen lines with micro:bit’s A and B input buttons. Shake it to use the micro:bit’s accelerometer input to raise and lower the pen, so you can move around without making a mark. The program keeps track the pen’s status (whether it’s up or down) using a variable called penUp. It shows different icons on the micro:bit’s output display so you know if the pen is up or down.