Challenge - 5 Problems
Arduino Hardware Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateWhat is the output of this Arduino sketch?
Consider this Arduino sketch that reads an analog sensor and prints a value. What will be printed on the Serial Monitor if the analog input reads 512?
Arduino
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(1000);
}Attempts:
2 left
💡 Hint
Think about what analogRead returns for a mid-range voltage.
✗ Incorrect
The analogRead function returns a value between 0 and 1023 representing the voltage on the analog pin. A reading of 512 corresponds to about half the reference voltage.
🧠 Conceptual
intermediateWhich component controls the timing of the Arduino microcontroller?
In the Arduino hardware architecture, which component is responsible for providing the clock signal that controls the timing of the microcontroller?
Attempts:
2 left
💡 Hint
This component vibrates at a fixed frequency to keep time.
✗ Incorrect
The crystal oscillator generates a stable clock signal that the microcontroller uses to time its operations.
🔧 Debug
advancedWhy does this Arduino sketch fail to blink the LED?
This sketch is intended to blink the built-in LED on pin 13. Why does it fail to blink?
Arduino
void setup() {
pinMode(13, INPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(500);
}Attempts:
2 left
💡 Hint
Check the pinMode configuration for the LED pin.
✗ Incorrect
The pinMode is set to INPUT, so writing HIGH or LOW does not control the LED. It must be set to OUTPUT.
📝 Syntax
advancedIdentify the syntax error in this Arduino sketch
Which option correctly fixes the syntax error in this sketch?
Arduino
void setup() {
Serial.begin(9600)
}
void loop() {
Serial.println("Hello");
delay(1000);
}Attempts:
2 left
💡 Hint
Look carefully at the end of the Serial.begin line.
✗ Incorrect
Missing semicolon causes a syntax error. Adding it fixes the problem.
🚀 Application
expertHow many digital pins can be used as PWM outputs on an Arduino Uno?
On an Arduino Uno board, how many digital pins support PWM (Pulse Width Modulation) output?
Attempts:
2 left
💡 Hint
PWM pins are marked with a tilde (~) on the board.
✗ Incorrect
The Arduino Uno has 6 digital pins capable of PWM output: 3, 5, 6, 9, 10, and 11.
