Font size
WorksheetsArduino Programming Quiz
Total questions: 35
Worksheet time: 25mins
What is the main programming language used to program Arduino?
Python
Java
C/C++
Assembly
What is the function pinMode() used for in Arduino?
To read a pin value
To set a pin as input or output
To reset a pin
To write analog value
What is the correct function to set a digital pin to HIGH in Arduino?
digitalMode(HIGH)
pinWrite(HIGH)
digitalWrite(HIGH)
digitalWrite(pin, HIGH)
Which of the following is a correct way to start the Serial Monitor?
Serial.start(9600);
Serial.begin(9600);
Begin.Serial(9600);
serialMonitor(9600);
Which pin on the Arduino Uno is used for analog input A0?
Pin 13
Pin 0
Pin A0
Pin D0
Which command is used to create a delay in milliseconds?
wait(1000);
pause(1000);
delay(1000);
hold(1000);
What is the data type used to store integer values in C?
string
float
int
double
What symbol is used to make a comment in C/Arduino code?
//
#
**
\
What is the result of 5 % 2 in C?
2
1
0
2.5
Which C statement is used to make decisions?
switch
if
while
both A and B
Which function is executed only once in an Arduino sketch?
loop()
main()
void()
setup()
Which function repeats forever in Arduino code?
loop()
setup()
mainloop()
run()
Which one is not a valid C data type?
bool
double
real
char
How do you declare a variable in C?
var x = 5;
int x = 5;
declare x = 5;
x := 5;
What is the correct way to define an array of 5 integers?
int a[5];
int a = [5];
array int[5];
int[5] a;
Arduino Uno has 6 analog input pins.
True
False
The loop() function in Arduino only runs once.
True
False
You can power the Arduino through the USB port.
True
False
‘int’ in C is used to store decimal numbers.
True
False
‘delayMicroseconds(1000)’ waits for 1 millisecond.
True
False
An ‘if’ statement must always have an ‘else’.
True
False
A resistor is needed when connecting an LED to an Arduino.
True
False
The ‘&&’ operator means logical OR.
True
False
C is a case-sensitive programming language.
True
False
A for loop can never be infinite.
True
False
The function used to print to the Serial Monitor is (a) .
The default baud rate for Arduino Serial communication is (a) .
A digital pin set to HIGH has a voltage of (a) .
To read an analog value from A0, use the function (a) .
The extension of an Arduino sketch file is (a) .
What does the following code do? digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000);
Keeps LED off
Turns LED on and off every second
Reads sensor value
No output
Find the error in this code: int x = "5";
What is the output of the following C code? int a = 5, b = 2; printf("%d", a / b);
(a)
What is the role of #include ?
Fix the following code to blink an LED on pin 7: void setup() { pinMode(7, INPUT); } void loop() { digitalWrite(7, HIGH); delay(500); digitalWrite(7, LOW); delay(500); }
