3. Potentiometer Code Ordering

3.1. Question 1

Put the snippets in order to read the dial position on Pin 2 and immediately output the raw data sequence onto the scrolling LED screen.
Drag and drop lines into the correct order and click to adjust indentation:
sleep(20)
while True:
pot_val = pin2.read_analog()
display.scroll(pot_val, delay=80)
from microbit import *

3.2. Question 2

A student hooks up an external LED component to Pin 0 alongside their dial on Pin 2.
Order the blocks below to feed the incoming analog dial values straight out to control the LED brightness level.
Drag and drop lines into the correct order and click to adjust indentation:
pin0.write_analog(pot_val)
while True:
pot_val = pin2.read_analog()
from microbit import *
sleep(40)

3.3. Question 3

Put the code snippets in order to build a dual-fading light system.
As Pin 0 gets brighter when the dial turns up, Pin 1 must safely dim down by subtracting the dial position from the maximum value.
Drag and drop lines into the correct order and click to adjust indentation:
pot_val = pin2.read_analog()
pin0.write_analog(pot_val)
pin1.write_analog(1023 - pot_val)
sleep(40)
from microbit import *
while True:

3.4. Question 4

Put the instructions in the correct order to create a low-threshold safety sensor switch.
If the dial value on Pin 2 drops strictly below 500, a warning indicator light on Pin 0 must switch to fully ON.
Drag and drop lines into the correct order and click to adjust indentation:
pot_val = pin2.read_analog()
from microbit import *
while True:
else:
pin0.write_digital(0)
if pot_val < 500:
pin0.write_digital(1)

3.5. Question 5

Order the lines below to build a high-threshold logic split circuit with an embedded status icon tracker.
When the dial crosses 500 or more, turn on Pin 1 and display a built-in happy face icon to show authorization.
Drag and drop lines into the correct order and click to adjust indentation:
from microbit import *
if pot_val >= 500:
pin0.write_digital(1)
else:
display.clear()
display.show(Image.HAPPY)
pin1.write_digital(0)
pin0.write_digital(0)
pot_val = pin2.read_analog()
sleep(40)
while True:
pin1.write_digital(1)

3.6. Question 6

Rearrange the code segments to create a multi-level signal routing system.
Handle low dial signals on Pin 0, middle dial signals on Pin 1, and high dial signals on Pin 8 sequentially.
Drag and drop lines into the correct order and click to adjust indentation:
pin1.write_digital(1)
pin8.write_digital(1)
elif pot_val < 600:
pin0.write_digital(1)
while True:
pot_val = pin2.read_analog()
else:
if pot_val < 300:
from microbit import *

3.7. Question 7

Rearrange the code segments to create a multi-level signal routing system.
Usse 3 zone switches to handle low dial signals on Pin 0, middle dial signals on Pin 1, and high dial signals on Pin 8 sequentially while ensuring that only one zone is active at a time.
Drag and drop lines into the correct order and click to adjust indentation:
pin1.write_digital(1)
pin8.write_digital(1)
elif pot_val < 600:
# Zone 1 Active Only
pin0.write_digital(0)
# Zone 3 Active Only
if pot_val < 300:
pin8.write_digital(0)
pin8.write_digital(0)
pot_val = pin2.read_analog()
sleep(20)
from microbit import *
pin1.write_digital(0)
while True:
# Zone 2 Active Only
else:
pin0.write_digital(1)
pin1.write_digital(0)
pin0.write_digital(0)