0
0
Raspberry Piprogramming~20 mins

Raspberry Pi vs Arduino comparison - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Raspberry Pi vs Arduino Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Main difference in processing power
Which statement best describes the main difference in processing power between Raspberry Pi and Arduino?
ARaspberry Pi has a full operating system and a powerful CPU, while Arduino uses a simple microcontroller with limited processing power.
BArduino has a full operating system and a powerful CPU, while Raspberry Pi uses a simple microcontroller with limited processing power.
CBoth Raspberry Pi and Arduino have similar processing power and run full operating systems.
DRaspberry Pi and Arduino both use microcontrollers with no operating system.
Attempts:
2 left
💡 Hint
Think about which device can run Linux and which cannot.
Predict Output
intermediate
2: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);
}
ARaspberry Pi prints 'Pin 18 set HIGH' and Arduino prints 'Pin 13 set HIGH'.
BRaspberry Pi prints nothing and Arduino prints 'Pin 13 set HIGH'.
CRaspberry Pi prints 'Pin 13 set HIGH' and Arduino prints 'Pin 18 set HIGH'.
DBoth Raspberry Pi and Arduino print nothing.
Attempts:
2 left
💡 Hint
Look at the print statements and pin numbers in each code.
🔧 Debug
advanced
1: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() {
}
ARuntimeError: digitalWrite called before pinMode.
BSyntaxError: Missing semicolon after pinMode line.
CNo error, code compiles and runs correctly.
DSyntaxError: Missing curly braces in setup function.
Attempts:
2 left
💡 Hint
Check punctuation at the end of each statement.
📝 Syntax
advanced
1: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?
AGPIO.output(17, GPIO.OUT)
BGPIO.setup(17, OUTPUT)
CGPIO.setup(17, GPIO.OUT)
DGPIO.setmode(17, GPIO.OUT)
Attempts:
2 left
💡 Hint
Remember the function to configure pin mode is 'setup'.
🚀 Application
expert
2: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?
AArduino, because it can run a full operating system for better control.
BRaspberry Pi, because it runs Linux and can multitask easily.
CRaspberry Pi, because it has more processing power for sensor reading.
DArduino, because it has real-time capabilities and low latency for precise timing.
Attempts:
2 left
💡 Hint
Consider which device handles real-time tasks better.