Font size
WorksheetsArduino - level 2
Total questions: 27
Worksheet time: 17mins
What is the name of the library that we include in our Arduino code to use this specific module?
DS3231.h
Servo.h
LiquidCrystal_I2C.h
Arduino.h
Choose two (2) usage of this component in your daily lives:
Reverse car sensor
Alarm clock
Speaker
Distance sensor
What are the TRUE differences between this component in the picture and a DC MOTOR?
This component can turn to specific angle and DC Motors cannot
This component need 3 wires to connect
DC Motor can turn to 180 degrees only
DC Motor needs a signal wire, 5V and GND; this component needs 2 wires only
Besides <LiquidCrystal_I2C.h> library, which other library is needed to use a Liquid Crystal Display I2C?
<Display.h>
<RS3231.h>
<Serial.h>
<Wire.h>
What does GPIO stand for?
General Purpose Inner Outer Propeller
General Purpose Input Output Pins
General Purpose Interested Old People
General Purpose Input Output Processor
Mark the WRONG written codes.
int X9=9;
Int x9=9;
serial.printLn(9600);
void setup {
Serial.begin(9600);
}
Which of the following is correct to write your name as a comment?
/ Myname
//Myname
/*Myname
<Myname>
For the following code, which statement (s) will be executed? (Note: you can choose more than one)
int x=3;
int y=4;
if(x>y)
{ statement A;}
else {Statement B;}
Statement C;
A
B
C
for the following code, What is the right output?
for(int i=1;i<3;i++)
{Serial.begin(9600);
Serial.print("Hello");
}
Hello
HelloHello
Hello
Hello
Hello Hello
HelloHelloHello
A potentiometer is a
Directional switch
Directional resistor
Sensor
Variable resistor
None of the above
Photo resistors operate by
Reducing resistance when less light is visible
Increasing resistance when less light is visible
Activates when motion is present
All of the above
Pins configured as OUTPUT with
PinMode()
Pinmode()
pinmode()
pinMode()
The command which is used to display the characters in the serial monitor is
Serial
Serial.type
Serial.printing
Serial.println
The line void setup() means that you are defining a function called setup
True
False
A function is a series of programming statements that can be called by name. Which command is called once when the program starts:
loop()
setup()
(output)
(input)
void()
What is the output for the following code?
int x=5;
int y=3;
x+=y;
Serial.print(x+y);
6
8
10
11
How to define a Led connected to pin 13 in Arduino?
Pinmode(13,INPUT);
pinMode(13,INPUT);
Pinmode(13,OUTPUT);
pinMode(13,OUTPUT);
Where is the position of this command?
pinMode(8, OUTPUT);
void setup()
void loop()
Where is the position of this command?
digitalWrite(8, HIGH);
void setup()
void loop()
What does A&&B mean
It is a logical AND operator
It is a logical OR operator
It is a multiplication operator
it is a division operator
A==7 means
A is equal to 7
7 is assigned as an int A
A is not equal to 7
A is greater than 7
A!=3 means
A is NOT equal to 3
A is equal to 3
A is greater than 3
A is less than 3
A||B is a/an
OR logical operator
AND logical operator
Greater than or equal
less than or equal
What is the correct pinMode setup code for this circuit?
pinMode(12, OUTPUT);
pinMode(8, INPUT);
pinMode(8, OUTPUT);
pinMode(7, INPUT);
An LED is an example of a Diode. What is the definition of Diode?
(HINT - an LED has a short leg and a long leg for this reason)
Electricity needs to be controlled by a resistor for it to work
It means LEDs can be multi-coloured
A jumper wire needs to go to GND (ground) after it is connected to the LED
Electricity can only flow through this component in one direction
int Led1=4;
void setup(){
digitalWrite (LED1, High);
}
Find the errors?
LED 1
DigitalWrite
HIGH
Void Setup
I use temperature sensor to read the room temperature. How do I write Temperature Sensor Set-up.
void setup(){
_______________________;
}
PinMode (Tsensor, Output);
pinMode (Tsensor, OUTPUT);
PinMode (Tsensor, Input);
pinMode (Tsensor, INPUT);
