NEW
Font size
WorksheetsGrade 6
Total questions: 10
Worksheet time: 5mins
What does the digitalWrite() function do in Arduino?
Reads the value from a pin
Writes a digital value to a pin
Delays the program
Initializes the program
Which function is called only once at the start of an Arduino program?
void loop()
void setup()
digitalWrite()
delay()
In the context of Arduino, what does the delay() function do?
It stops the program
It pauses the program for a specified time
It initializes variables
It reads sensor data
Which of the following is the correct way to declare a pin as an output in void setup()?
pinMode(pin, INPUT);
pinMode(pin, OUTPUT);
digitalWrite(pin, HIGH);
delay(pin);
If you want to turn on an LED connected to pin 7, which command should you use?
digitalWrite(7, HIGH);
digitalWrite(7, LOW);
pinMode(7, HIGH);
delay(7);
What is the purpose of the void loop() function in Arduino?
To execute code only once
To repeat the code continuously
To read input from sensors
To set up the initial conditions
Which unit is used to measure electric current?
Volt
Ampere
Ohm
Watt
How do you turn off an LED connected to pin 8?
digitalWrite(8, HIGH);
digitalWrite(8, LOW);
pinMode(8, LOW);
delay(8);
What happens if you forget to call pinMode() for a pin?
The pin will automatically be set to OUTPUT
The pin will not function as expected
The program will crash
Nothing; it will work fine
If you wanted to create a simple program that turns on three LEDs in sequence, what would you use?
Only delay()
Only digitalWrite()
Both delay() and digitalWrite()
Only void setup()
