Challenge - 5 Problems
Raspberry Pi vs Arduino Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Main difference in processing power
Which statement best describes the main difference in processing power between Raspberry Pi and Arduino?
Attempts:
2 left
💡 Hint
Think about which device can run Linux and which cannot.
✗ Incorrect
Raspberry Pi runs a full operating system like Linux and has a powerful CPU. Arduino uses a microcontroller without an OS and has limited processing power.
❓ Predict Output
intermediate2:00remaining
GPIO pin control difference
What will be the output of this code snippet on Raspberry Pi and Arduino respectively?
Raspberry Pi
Raspberry Pi (Python): import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) GPIO.output(18, GPIO.HIGH) print('Pin 18 set HIGH') Arduino (C++): void setup() { pinMode(13, OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(13, HIGH); Serial.println("Pin 13 set HIGH"); delay(1000); }
Attempts:
2 left
💡 Hint
Look at the print statements and pin numbers in each code.
✗ Incorrect
The Raspberry Pi code prints 'Pin 18 set HIGH' after setting GPIO pin 18 high. The Arduino code prints 'Pin 13 set HIGH' after setting pin 13 high.
🔧 Debug
advanced1:30remaining
Identify error in Arduino code
What error will this Arduino code produce when compiled?
Raspberry Pi
void setup() {
pinMode(13, OUTPUT)
digitalWrite(13, HIGH);
}
void loop() {
}Attempts:
2 left
💡 Hint
Check punctuation at the end of each statement.
✗ Incorrect
The line 'pinMode(13, OUTPUT)' is missing a semicolon at the end, causing a syntax error.
📝 Syntax
advanced1:00remaining
Correct Python syntax for Raspberry Pi GPIO setup
Which option shows the correct Python syntax to set GPIO pin 17 as an output on Raspberry Pi?
Attempts:
2 left
💡 Hint
Remember the function to configure pin mode is 'setup'.
✗ Incorrect
The correct function to set a pin as output is 'GPIO.setup(pin_number, GPIO.OUT)'.
🚀 Application
expert2:30remaining
Choosing device for a real-time sensor project
You want to build a project that reads sensor data every millisecond and controls motors with precise timing. Which device is better suited and why?
Attempts:
2 left
💡 Hint
Consider which device handles real-time tasks better.
✗ Incorrect
Arduino is better for real-time tasks with precise timing because it runs bare-metal code without an OS, minimizing delays.