Arduino Board: Arduino Board Arduino Uno Arduino Mega Arduino Nano
Arduino Board: Arduino Board Arduino Uno Arduino Mega Arduino Nano
It
consists of a microcontroller, a development environment (IDE), and a set of libraries that
make it easy to program and interact with physical devices like sensors, actuators, motors, and
displays.
1. Arduino Board
• The Arduino IDE is a software where you can write and upload your programs
(called sketches) to an Arduino board. It is available for Windows, Mac, and Linux.
• The IDE uses the C/C++ programming language with some simplified syntax for ease
of use.
3. Arduino Sketch
• An Arduino sketch is the code that runs on an Arduino board. It consists of two main
functions:
o setup(): This function runs once when the program starts and is used to
initialize settings like pin modes.
o loop(): This function runs repeatedly after setup() and controls the
program's main functionality.
4. Common Components
• LEDs: Often used to indicate the status or feedback from the program.
• Sensors: Devices that detect environmental conditions like temperature, humidity,
light, etc. Examples include DHT11 (temperature and humidity), PIR (motion
detection), and ultrasonic sensors for distance.
• Motors: DC motors, stepper motors, and servo motors are controlled using Arduino.
• Displays: LCDs, LEDs, and OLED screens to display information.
• Actuators: Devices that perform actions, like relays and servos.
cpp
Copier le code
void setup() {
pinMode(13, OUTPUT); // Set pin 13 as an output
}
void loop() {
digitalWrite(13, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(13, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
6. Shields
• Arduino Shields are pre-built circuit boards that plug directly into the Arduino board
to add extra functionality. Popular shields include:
o Motor Shield: For controlling motors.
o Ethernet Shield: To connect the Arduino to the internet via an Ethernet cable.
o LCD Shield: For adding an LCD display.
7. Arduino Libraries
• Libraries are collections of pre-written code that allow you to interact with specific
sensors, actuators, or devices. You can easily import them into your sketch to control
more complex components.