1/27
Looks like no tags are added yet.
Computer program
A set of instructions for performing tasks.
• C programming language
Developed by Dennis Ritchie.
• C++ programming language
Created by Bjarne Stroustrup.
Arduino programming
Uses C and C++.
Digital signals –
Two states: HIGH and LOW.
Represent a range of values.
Represent a range of values.
setup()
Runs once at startup or reset.
loop()
Repeats instructions continuously.
pinMode(pin, OUTPUT)
Configures a pin as an output.
pinMode(pin, INPUT)
Configures a pin as an input.
digitalWrite(pin, HIGH)
Sets an output pin HIGH.
digitalWrite(pin, LOW)
Sets an output pin LOW.
digitalRead(pin)
Reads the state of a digital input pin.
delay(1000)
Pauses execution for 1,000 milliseconds (1
second).
most statements end with a semicolon (;); braces { }
group statements.
most statements end with a semicolon (;); braces { }
group statements.
Resistor
Limits electric current.
LED
Resistor
Anode / Cathode
Positive / negative LED terminals.
Switch
Opens or closes a circuit.
Push button
Momentary switch operated by pressing.
RGB LED
Combines red, green, and blue light.
Ground (GND)
Common voltage reference point.
Schematic diagram
Represents circuit connections using symbols.
Parallel circuit
Components connected in separate branches.
Open circuit
Interrupted path; current cannot flow through that
path.
Closed circuit
Complete path allowing current
• A push button provides input; the LED provides output.
• A push button provides input; the LED provides output.
• digitalRead() checks a button input; digitalWrite() controls an LED output.
• digitalRead() checks a button input; digitalWrite() controls an LED output.