Challenge - 5 Problems
Hardware Confidence Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Why do LED projects help beginners understand hardware?
Which of the following best explains why working with LEDs helps beginners build hardware confidence?
Attempts:
2 left
💡 Hint
Think about how beginners can quickly tell if their setup is correct.
✗ Incorrect
LEDs light up when powered correctly, giving instant visual confirmation that the hardware and code are working together.
🧠 Conceptual
intermediate1:30remaining
How do button projects improve hardware skills?
Why do button projects help learners understand hardware better?
Attempts:
2 left
💡 Hint
Think about what happens when you press a button in a circuit.
✗ Incorrect
Buttons let learners see how physical actions create electrical signals that the Raspberry Pi can read and respond to.
❓ Predict Output
advanced2:00remaining
What is the output when pressing the button in this Raspberry Pi code?
Given the code below, what will be printed when the button connected to GPIO 17 is pressed?
Raspberry Pi
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP) try: while True: if GPIO.input(17) == GPIO.LOW: print('Button Pressed') time.sleep(0.5) except KeyboardInterrupt: GPIO.cleanup()
Attempts:
2 left
💡 Hint
Check what GPIO.LOW means for a button with pull-up resistor.
✗ Incorrect
The button pulls the input to LOW when pressed, triggering the print statement.
❓ Predict Output
advanced2:00remaining
What will the LED do in this Raspberry Pi script?
Consider this code controlling an LED on GPIO 18. What will the LED do when the script runs?
Raspberry Pi
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) for i in range(3): GPIO.output(18, GPIO.HIGH) time.sleep(1) GPIO.output(18, GPIO.LOW) time.sleep(1) GPIO.cleanup()
Attempts:
2 left
💡 Hint
Look at the loop and the sleep times.
✗ Incorrect
The loop turns the LED on, waits 1 second, off, waits 1 second, repeating 3 times.
🔧 Debug
expert2:30remaining
Why does this Raspberry Pi button code fail to detect presses?
This code is supposed to print 'Pressed' when the button is pressed, but it never prints anything. What is the cause?
Raspberry Pi
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) while True: if GPIO.input(17) == GPIO.LOW: print('Pressed') time.sleep(0.5)
Attempts:
2 left
💡 Hint
Think about what happens to input pins without pull resistors.
✗ Incorrect
Without pull-up or pull-down resistors, the input pin can float and never reliably read LOW when pressed.