wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Arduino Basic Programming

Total questions: 64

Worksheet time: 40mins

Name
Class
Date
1.

int LED1= 4;

What statement is this?

a)

Void Loop

b)

Void Setup

c)

Declaration

d)

C language

2.

int LED1=4;

What is 'int= integer' used for?

a)

Alphabets

b)

Capital and small letters

c)

Combination of Numbers and Alphabets

d)

Numbers

3.

int LED2=8;

What is number eight is referring in the coding above?

a)

Analog Pin

b)

5V

c)

Ground

d)

Digital Pin

4.

digitalWrite (LED1,HIGH);

What does it means by HIGH?

a)

Blinking

b)

Switch OFF

c)

Switch ON

d)

Sequence

5.

delay (1000);

1000 in delay is equivalent to how many second?

a)

10s

b)

2s

c)

60s

d)

1s

6.

digitalWrite (LED1, HIGH);

delay(1000);

digitalWrite (LED1, LOW);

What does the program do?

a)

LED Switch Off at the beginning, wait for 60s and then switch ON.

b)

LED Switch ON at the beginning, wait for 10s and then Switch OFF.

c)

LED Switch ON at the beginning, wait for 1s and then switch ON.

d)

LED Switch ON at the beginning, wait for 1s and then switch OFF.

7.
How long is the LED on?

digitalWrite(13, HIGH); 
 
delay(1000);   
digitalWrite(13, LOW); 
 
delay(1000); 
a)
1000 seconds
b)
100 seconds
c)
1 second
d)
100 milliseconds
8.
Which symbol ends a statement?
a)
Semicolon ;
b)
Parenthesis )
c)
Comma ,
d)
Curly Brace }
9.
Which pin is the jumper wire connected to?

digitalWrite(13, HIGH); 
 
delay(1000);   
digitalWrite(13, LOW); 
 
 delay(1000); 
a)
13
b)
12
c)
100
d)
digital pin
10.
A function is a series of programming statements that can be called by name. Which command is called repetitively over and over again as long as the Arduino has power.
a)
loop()
b)
setup()
c)
(output)
d)
(input)
11.
A function is a series of programming statements that can be called by name. Which command is called once when the program starts:
a)
loop()
b)
setup()
c)
(output)
d)
(input)
12.
What does pressing the check-mark do when working with your code?
a)
Saves your work.
b)
Downloads your code onto the arduino board.
c)
Checks your code for mistakes.
d)
Checks to see if the arduino is connected to the computer.
13.

5. What is the definition of function?

a)

Has inputs and outputs

b)

Every input has only ONE output

c)

Inputs have different outputs every time

d)

x-values and y-values

14.

What symbol is used to indicate a comment in Arduino programming?

a)

//

b)

##

c)

/*

d)

!!

15.

How do you declare a variable in Arduino programming?

a)

variable_name data_type;

b)

declare variable_name as data_type;

c)

int variable_name;

d)

data_type variable_name;

16.

How do you write a digital output to a specific pin in Arduino programming?

a)

writeDigital(pin, value)

b)

setPinOutput(pin, value)

c)

outputDigital(pin, value)

d)

digitalWrite(pin, value)

17.

What is the function of the loop() in Arduino programming?

a)

To execute the program once

b)

To execute the program repeatedly after setup() has been called

c)

To pause the program for a specified amount of time

d)

To end the program

18.

What is the function of the delayMicroseconds() function in Arduino programming?

a)

To pause the program for a specified amount of time in microseconds.

b)

To speed up the program execution

c)

To skip a section of the code

d)

To restart the program

19.

LED is setup-up to blink. LEDs is an

a)

Output

b)

Input

c)

pinMode

d)

digitalWrite

20.

What is function of setup () ?

a)

To initialize variables, pin modes, start using libraries.

b)

Allowing your program to change and respond.

c)

It indicates that the function is expected to return no information to the function from which it was called.

21.

What is function of void () ?

a)

To initialize variables, pin modes, start using libraries

b)

Allowing the program to change, respond, and control the Arduino board.

c)

It indicates that the function is expected to return no information to the function from which it was called.

22.

What is function of loop () ?

a)

To initialize variables, pin modes, start using libraries

b)

It indicates that the function is expected to return no information to the function from which it was called

c)

Allowing the program to change, respond, and control the Arduino board

23.

Which one of the following arduino design below refer to the code as shown in the figure ?

a)
b)
c)
24.

Which one of the following arduino code are TRUE ?

a)
b)
c)
25.
Before your program “code” can be sent to the board, it needs to be converted into instructions that the board understands. This process is called...
a)
Stop
b)
Compile
c)
Create Sketch
d)
Serial Monitor
26.
If a pin is set to HIGH; it is considered to be ________
a)
On
b)
Off
c)
Once
d)
Twice
27.
Writes a HIGH or a LOW value to a digital pin.
a)
digitalWhat
b)
digitalWet 
c)
digitalWrong
d)
digitalWrite
28.
The pinMode() function configures a pin as either ______or In ________
a)
High or Low
b)
Input or Output
c)
Input or Off
d)
Inside or Outside
29.
All programming in a void setup or void loop must take place between
a)
{ } Curly Braces
b)
() Brackets
c)
\\ Forwardslashs
d)
// Backslashs
30.
The programming language used by the Arduino microprocessor is _________?
a)
Java
b)
Python
c)
C++
d)
PHP
31.

I use temperature sensor to read the room temperature. How do I write Temperature Sensor Set-up.

void setup(){

_______________________;

}

a)

PinMode (Tsensor, Output);

b)

pinMode (Tsensor, OUTPUT);

c)

PinMode (Tsensor, Input);

d)

pinMode (Tsensor, INPUT);

32.

What does IDE stand for?

a)

Integrated Development Environment

b)

In Deep Environment

c)

Internal Deep Escape

d)

IDE

33.

A program written with the IDE for Arduino is calle

a)

Editor

b)

Console

c)

Sketch

d)

IDE error

34.
What does this sketch do?
a)
This sets up the pin that our LED is connected to as an OUTPUT pin.
b)
This sets up the pin that our LED is connected to as an INPUT pin
c)
This sets up and LED to turn off
d)
Turns the LED off by writing LOW out on the pin.
35.

What is a Variable?

a)

It is a place where you can store some data

b)

It is a place in your code that changes

c)

It is a name given to a special sub-routine that changes how the program works

d)

It is when you want to add two number together

36.
A function is a series of programming statements that can be called by name. Which command delays the LED by a number of milliseconds is.
a)
loop()
b)
setup()
c)
delay()
d)
stop()
37.
If we start by writing HIGH out on the pin connected to the LED. What will it make the LED do? (HIGH means putting 5V out on the pin)
a)
Turn the LED on
b)
Turn the LED off
38.
If we start by writing LOW out on the pin connected to the LED. What will it make the LED do? (LOW means putting 0V out on the pin)
a)
Turn the LED on
b)
Turn the LED off
39.

Which LED is ON ?

a)

8

b)

9

c)

None!

d)

ALL!

40.

Where is the position of this command?

pinMode(8, OUTPUT);

a)

void setup()

b)

void loop()

41.

Where is the position of this command?

digitalWrite(8, HIGH);

a)

void setup()

b)

void loop()

42.

How header file is to be defined to code for servo motors?

a)

# define Servo

b)

# include Servo

c)

#include<Servo.h>

d)

Servo myservo;

43.

If servo object is myServo and then servo control signal to make 150 degree angle, is coded as

a)

myServo.write(150);

b)

myServo.Write(852.5);

c)

myServo.write(852.5);

d)

analogWrite(852.5);

44.

Servo signal pin must be connected to

a)

any digital pin of Arduino

b)

analog input pins A0 to A5

c)

any one of the PWM pins

d)

5V pin

45.

What type of actuator would be best suited to operating a robot arm?

a)

Servo

b)

Solenoid

c)

DC Motor

d)

None of the above

46.

Inputs are

a)

Speaker

b)

Mouse

c)

Keyboard

d)

Printer

47.

Outputs are:

a)

Mouse

b)

Screen

c)

Speaker

d)

Keyboard

e)

Printer

48.

Ultrasonic waves are a form of _______ waves

a)

sound

b)

ocean

c)

radio

d)

seismic

49.

How many volts do the ultrasonic sensors need to operate?

a)

5v

b)

12v

c)

3v

d)

10v

50.

An ultrasonic sensor is a device that can measure the ________ to an object by sending out _________ waves.

a)

density / echo

b)

path / seismic

c)

elevation / sonic

d)

distance / sound

51.

What type of sensor would be used in this kettle?

a)

Light Sensor

b)

Temperature Sensor

c)

Infra-red sensor

d)

Pressure Sensor

52.

What is the minimum Voltage to power up an Arduino uno module?

a)

A. 4V

b)

B. 12V

c)

C. 24 V

d)

D. 5 V

53.

What is the code used to input a library on your sketch?

a)

A. #determine

b)

B. #input

c)

C. #include

d)

D. #define

54.

What is the function of the setup() in Arduino programming?

a)

It is used to initialize the Arduino board and prepare it for the main loop

b)

It is used to control the speed of the Arduino board

c)

It is used to turn off the Arduino board

d)

It is used to play music on the Arduino board

55.

What is the function of the loop() in Arduino programming?

a)

Stops the code from running

b)

Runs the code only once

c)

Executes the code continuously

d)

Resets the Arduino board

56.

What is the syntax for declaring a variable in Arduino programming?

a)

variable_name = data_type;

b)

data_type variable_name;

c)

variable_name data_type;

d)

variable_name = new data_type;

57.

How do you write a comment in Arduino programming?

a)

// Use double forward slashes (//) for single-line comments or /* */ for multi-line comments.

b)

Use double forward slashes (//) for multi-line comments or /* */ for single-line comments.

c)

Use double forward slashes (//) for single-line comments or for multi-line comments.

d)

Use double backward slashes (\) for single-line comments or /* */ for multi-line comments.

58.

What is the purpose of the pinMode() function in Arduino programming?

a)

To change the color of the LED

b)

To play a sound

c)

To print a message on the serial monitor

d)

To configure a specific pin as an input or output

59.

What is the difference between digitalRead() and digitalWrite() functions in Arduino programming?

a)

They are used for measuring temperature

b)

They are used for controlling servo motors

c)

They are used for playing sound

d)

They are used for reading and writing digital signals on Arduino pins.

60.

Explain the use of the analogRead() function in Arduino programming.

a)

It is used to read the analog voltage value from a specified analog pin.

b)

It is used to control the speed of a servo motor.

c)

It is used to write digital values to an analog pin.

d)

It is used to measure the frequency of an analog signal.

61.

What are the two main parts of an Arduino program?

a)

A) setup and main

b)

B) loop and main

c)

C) setup and loop

d)

D) start and end

62.

Which part of the Arduino program runs only once?

a)

A) loop

b)

B) setup

c)

C) main

d)

D) end

63.

Which part of the Arduino program runs repeatedly?

a)

A) setup

b)

B) loop

c)

C) main

d)

D) end

64.

Which pin mode is used for an LED in the Arduino setup function?

a)

A) pinMode(ledPin, INPUT);

b)

B) pinMode(ledPin, OUTPUT);

c)

C) pinMode(ledPin, ANALOG);

d)

D) pinMode(ledPin, PWM);