Search Header Logo

Arduino Review 1

Authored by Keith Lavigne

Computers

9th - 12th Grade

Used 1+ times

Arduino Review 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following c++ code used for programming an Arduino uno:

pinMode(12, OUTPUT);

What is the effect of this code on the Arduino uno?

Pin 12 is set to HIGH by default.
Pin 12 is configured as an output pin.
Pin 12 is configured as an input pin.
Pin 12 is disabled and cannot be used.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are programming an Arduino Uno and wish to use pin 8 to read data from a connected component. What c++ code should you write?

pinMode(8, OUTPUT); int value = digitalWrite(8);
int value = analogRead(8); pinMode(8, INPUT);
digitalRead(8); pinMode(8, INPUT_PULLUP);
pinMode(8, INPUT); int value = digitalRead(8);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are programming an Arduino uno using c++ code. You add code the the void setup() function. When will that code be executed and how many times will it run?

The code will run continuously until stopped.
The code will be executed every time the loop runs.
The code will be executed twice.

The code will be executed once when the Arduino powers on.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are programming an Arduino uno using c++. The Uno has LED lights connected to pins 4,5,6,and 7. How would you program the arduino to light the LEDs sequentially from 4 to 7 for 200ms each?

void setup() { pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); } void loop() { for (int pin = 4; pin <= 7; pin++) { digitalWrite(pin, HIGH); delay(200); digitalWrite(pin, LOW); } }
void setup() { pinMode(4, OUTPUT); pinMode(5, OUTPUT); } void loop() { digitalWrite(4, HIGH); delay(200); digitalWrite(5, HIGH); delay(200); }
void setup() { pinMode(4, OUTPUT); } void loop() { for (int pin = 4; pin < 7; pin++) { digitalWrite(pin, HIGH); delay(200); } }
void setup() { pinMode(4, INPUT); } void loop() { digitalWrite(4, HIGH); delay(200); }

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are programming an Arduino Uno using c++. You wish to read and write data from the serial monitor. What method must you call prior to reading from or writing to the serial monitor?

Serial.read()
Serial.start(baud_rate)
Serial.begin(baud_rate)
Serial.writeData()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When programming an Arduino Uno in c++ to write information to the serial monitor, what is the difference between Serial.print() and Serial.println()?

Serial.print() can only print integers, while Serial.println() can print all data types.
Serial.print() adds a newline, while Serial.println() does not.
Serial.print() is used for debugging, while Serial.println() is for data logging.
Serial.print() does not add a newline, while Serial.println() does.

7.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

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.

loop()
setup()
(output)
(input)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?