Arduino Sketch (Coding)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/58

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:48 AM on 10/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

59 Terms

1
New cards

Single-Line Comment

Anything after this on a line is ignored by the compiler; used to explain code to human readers.

2
New cards

/* */

Syntax used for multi-line comments in Arduino C/C++.

3
New cards

void setup()

A required Arduino function that runs only once when the board powers on or is reset.

4
New cards

void

Indicates that a function does not return any value.

5
New cards

void loop()

A required Arduino function that runs continuously in an infinite loop after setup() completes.

6
New cards

pinMode(pin, mode)

Configures a specific pin's behavior as either an INPUT, OUTPUT, or INPUT_PULLUP.

7
New cards

LED_BUILTIN

A constant representing the pin number of the board's onboard LED (e.g., Pin 13 on Uno, Pin 2 on many ESP32s).

8
New cards

OUTPUT

A pin mode setting that allows the board to send voltage out to power external components.

9
New cards

INPUT

A pin mode setting that configures a pin to read incoming electrical signals.

10
New cards

Semicolon (;)

The required character used to terminate a statement in C/C++; forgetting it is the most common beginner syntax error.

11
New cards

digitalWrite(pin, value)

Sets an output pin's voltage state to either HIGH or LOW.

12
New cards

HIGH

Represents full output voltage (5V on Uno, 3.3V on ESP32), turning connected components on.

13
New cards

LOW

Represents zero volts (0V or Ground), turning connected components off.

14
New cards

delay(ms)

Pauses program execution for a specified number of milliseconds; it is a blocking function that halts all other operations.

15
New cards

int

A data type used to store whole integers (both positive and negative).

16
New cards

Global Variable

A variable declared outside of any function, accessible by all functions and retaining its value throughout runtime.

17
New cards

Serial.begin(baudRate)

Initializes serial communication over USB at a specified speed (baud rate).

18
New cards

Baud Rate

The speed of serial communication in bits per second; must match between the board and Serial Monitor to prevent corrupted output.

19
New cards

Serial.print()

Sends text or values to the Serial Monitor without appending a newline at the end.

20
New cards

Serial.println()

Sends text or values to the Serial Monitor and appends a newline character.

21
New cards

counter++

Increments the value of counter by 1; shorthand for "counter = counter + 1;".

22
New cards

Serial Monitor

A tool in the Arduino IDE (Tools → Serial Monitor) used to view serial data sent from the board.

23
New cards

const

A keyword declaring that a variable's value is read-only and cannot be altered during execution.

24
New cards

INPUT_PULLUP

A pin mode that activates an internal resistor holding the pin HIGH when unpressed, preventing floating inputs without requiring external resistors.

25
New cards

Floating Pin

An unconnected input pin that randomly fluctuates between HIGH and LOW due to electrical noise.

26
New cards

digitalRead(pin)

Reads the digital signal of a pin and returns either HIGH or LOW.

27
New cards

Comparison Operator (==)

Checks if two values are equal; distinct from assignment operator (=).

28
New cards

Assignment Operator (=)

Assigns the value on the right to the variable on the left.

29
New cards

Logical NOT (!)

Flips a boolean value, changing true to false and false to true.

30
New cards

Logical OR (||)

Evaluates to true if at least one of the conditions listed is true.

31
New cards

millis()

Returns the elapsed milliseconds since the board powered on or reset; used for non-blocking timing tasks.

32
New cards

millis() Rollover

The resetting of the millis() timer back to 0, which occurs after approximately 49 days of continuous running.

33
New cards

unsigned long

A large, non-negative integer data type; required for storing values returned by millis().

34
New cards

bool

A data type that holds only two possible values: true or false.

35
New cards

Non-Blocking Code

Programming methods (like using millis()) that allow tasks to run concurrently without halting loop execution.

36
New cards

analogRead(pin)

Reads voltage from an analog pin and converts it into a digital integer representation via an ADC.

37
New cards

Analog-to-Digital Converter (ADC)

An internal hardware module that converts analog voltage levels into digital numerical values.

38
New cards

ESP32 ADC Resolution

12-bit resolution, yielding an analog output value ranging from 0 to 4095.

39
New cards

Arduino Uno ADC Resolution

10-bit resolution, yielding an analog output value ranging from 0 to 1023.

40
New cards

float

A data type used to store floating-point numbers containing decimal points.

41
New cards

Integer Division

An arithmetic operation involving only integers that drops decimal values unless explicitly converted to floating point.

42
New cards

ESP32 ADC1 Pins

GPIO pins 32 to 39, which remain functional for analog reading even when Wi-Fi is active (unlike ADC2 pins).

43
New cards

Pulse Width Modulation (PWM)

A technique that rapidly switches a digital pin on and off to simulate analog voltage variations.

44
New cards

Duty Cycle

The ratio of time a signal is active (HIGH) relative to its total period, controlling output intensity/brightness.

45
New cards

ledcAttach(pin, freq, res)

Configures a GPIO pin for PWM generation on ESP32 (Arduino core 3.x), defining its frequency and bit resolution.

46
New cards

ledcWrite(pin, duty)

Sets the active duty cycle value for a designated PWM pin on ESP32.

47
New cards

analogWrite(pin, duty)

Generates a PWM signal on designated PWM pins (marked with ~) on an Arduino Uno.

48
New cards

#include

A preprocessor directive that incorporates external library files into a sketch prior to compilation.

49
New cards

char*

A C/C++ data type representing a string (pointer to a sequence of characters).

50
New cards

ESP32 Wi-Fi Frequency

The wireless network band supported by ESP32 modules (2.4 GHz only; 5 GHz is unsupported).

51
New cards

WebServer server(port)

Instantiates an HTTP server object listening on a specified port (default HTTP port is 80).

52
New cards

HTTP Status Code 200

The standard HTTP response status code indicating that a request was successful (OK).

53
New cards

HTTP Status Code 303

An HTTP response status code indicating a redirection ("See Other") to a different URI.

54
New cards

Escape Character (\)

A backslash used in strings to allow special characters like quotation marks (\") to be processed as text.

55
New cards

WiFi.begin(ssid, password)

Initiates an asynchronous connection attempt to a Wi-Fi network using provided credentials.

56
New cards

WiFi.status()

Returns the current Wi-Fi connection status (e.g., WL_CONNECTED).

57
New cards

WiFi.localIP()

Retrieves the IP address assigned to the board by the network router.

58
New cards

server.on(path, handler)

Binds an incoming HTTP request route/path to a specific function handler.

59
New cards

server.handleClient()

Checks for incoming web client requests and triggers their corresponding handler functions; must be called continuously in loop().