Arduino Programming Flashcards

Module 3A (27 cards)

1
Q

it is the program written in the Arduino IDE that runs on an Arduino board.

A

a sketch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

called once when the Arduino board is powered on or reset. It is used to initialize variables, set pin modes, and perform any necessary setup tasks.

A

setup() function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

called repeatedly after the setup() function. It contains the main code that will run continuously on the Arduino board.

A

loop() function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

these are lines in your code that are not executed. They are meant for explaining the code, providing context, or leaving notes for yourself or others.

A

comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are the 2 types of comments

A
  • single-line comment
  • multi-line comment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

used to store and manipulate data in a program.

A

variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

common data types include?

A
  • int: used to store whole numbers.
  • float: used to store floating-point numbers with decimal places.
  • char: used to store single characters.
  • bool: used to store boolean values (true or false).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

scope of variable that declares outside functions and accessible throughout the program.

A

global variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

scope of variable that declares inside a function and only accessible within that function.

A

local variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

special symbols in C++ that perform operations on variables and values.

A

operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what are the categories of operators?

A
  • Arithmetic Operators
  • Relational Operators
  • Logical Operators
  • Assignment Operators
  • Increment and Decrement
    Operators
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

used to perform basic mathematical operations.

A

arithmetic operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

used to compare two values.

A

relational operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

used to combine multiple conditions. They include logical AND (&&), logical OR (||), and logical NOT (!).

A

logical operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

used to assign a value to a variable.

A

assignment operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

used to increase or decrease the value of a variable by 1.

A

increment (++) and decrement (–) operators

14
Q

allow a program to make decisions and execute different code paths based on whether a condition is true or false.

A

conditional statements

15
Q

it is useful for iterating over a range of values or repeating a set of instructions a specific number of times.

16
Q

this continuously executes a block of code as long as a specified condition remains true

17
Q

This command initializes the Serial communication at a specified baud rate (e.g., 9600).

A

Serial.begin(baud_rate)

18
Q

This command sends data to the Serial Monitor followed by a newline character.

A

Serial.println(data)

19
Q

Similar to Serial.println(), but it does not append a newline character at the end.

A

Serial.print(data)

20
Q

Reads incoming serial data.
This command retrieves the first byte of incoming serial data available and returns it as a character. If no data is available, it returns -1.

A

Serial.read()

21
Q

Returns the number of bytes available to read from the serial buffer. This command helps determine if there is any incoming data before attempting to read it, preventing errors when no data is available

A

Serial.avaialble()

22
used to control digital pins on the Arduino board.
digitalWrite
23
This function is primarily used to control LEDs, relays, or other digital devices connected to the Arduino.
digitalWrite
24
sed to generate a Pulse-Width Modulation (PWM) signal on specific pins of the Arduino board.
analogWrite