Arduino || TinkerCad II RGB with Arduino II Analog (Potentiometer) for LED

  Рет қаралды 413

Nicholas Maibela

Nicholas Maibela

Күн бұрын

In this video we introduce you to Arduino circuit designing and programming in both Block and Text C++ languages. Please subscribe for more videos like this
Exercise 2: RGB with Arduino
Scenario:
• The red, orange and green LED legs are connected to two pins on the Arduino and pin 13, pin 12 and pin 11 on the anode side, and on the cathode side they are connected to the ground (GND).
• Resistors are put between the LEDs and pin, 13, pin 12 and 11 which helps to limit the current going to the LED to prevent it from burning out.
• The LED of the device is polarized (has a positive(anode) and negative(cathode) side). The anode is wired to power (pin 13) while the cathode is wired to the ground.
• When the circuit is connected, the red LED is turn on for 4 seconds then turn off, then the orange and LEDs are turned on and off through the same process.
• This process will repeat indefinitely.
Components Required:
• Arduino Uno R3 Microcontroller Board
• Red LED
• Orange LED
• Green LED
• Connecting Jumper Wires
• 3 x 220Ω Resistor
• Breadboard
Code in Arduino C++:
int AnimationSpeed = 0;
void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
}
void loop()
{
AnimationSpeed = 4;
digitalWrite(13, HIGH);
delay(1000 * AnimationSpeed); // Wait for 1000 * AnimationSpeed millisecond(s)
digitalWrite(13, LOW);
delay(1000 * AnimationSpeed); // Wait for 1000 * AnimationSpeed millisecond(s)
digitalWrite(12, HIGH);
delay(1000 * AnimationSpeed); // Wait for 1000 * AnimationSpeed millisecond(s)
digitalWrite(12, LOW);
delay(1000 * AnimationSpeed); // Wait for 1000 * AnimationSpeed millisecond(s)
digitalWrite(11, HIGH);
delay(1000 * AnimationSpeed); // Wait for 1000 * AnimationSpeed millisecond(s)
digitalWrite(11, LOW);
delay(1000 * AnimationSpeed); // Wait for 1000 * AnimationSpeed millisecond(s)
}
Exercise 3: Analog (Potentiometer) for LED
Scenario:
• The LED legs are connected to two pins on the Arduino which include the ground (GND) and pin 13.
• A resistor is put between the LED and pin 13 which helps to limit the current going to the LED to prevent it from burning out.
• A potentiometer is placed on the circuit, through which its terminal 1 is connected to the 5V power source, Terminal 2 is connected to GND, and the wiper node is connected to analog signal A0.
• A multimeter is connected to the potentiometer to read the whereby the positive side of the multimeter is connected to terminal 1 and the negative side is connected to the wiper node.
• When the circuit is connected, the value of the analog signal will be read from A0 which is controlled by the value of the potentiometer, when the potentiometer is at the closed position the resistance will be at the max hence enabling low current to pass through but when the potentiometer is at the open position the resistance will be at its low hence enabling more current to pass through.
• This process is repeated indefinitely.
Components Required:
• Red LED light
• Connecting Jumper Wires
• 250Ω max Potentiometer
• 220Ω resistor
• Arduino Uno R3 microcontroller
• Breadboard
• Multimeter
Code in Arduino C++:
// C++ code
//
int POT = 0;
int LED = 0;
void setup()
{
pinMode(A0, INPUT);
pinMode(6, OUTPUT);
}
void loop()
{
POT = analogRead(A0);
LED = map(POT, 0, 1023, 0, 255);
analogWrite(6, POT);
delay(10); // Delay a little bit to improve simulation performance
}}

Пікірлер
How to do multiple tasks in Arduino | Beginners | millis() function
10:23
AI can't cross this line and we don't know why.
24:07
Welch Labs
Рет қаралды 455 М.
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 125 МЛН
Пришёл к другу на ночёвку 😂
01:00
Cadrol&Fatich
Рет қаралды 9 МЛН
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
I Built The First LAMINAR FLOW ROCKET ENGINE
15:51
Integza
Рет қаралды 2 МЛН
AirPods 4 Review: Which Ones To Get?
11:26
Marques Brownlee
Рет қаралды 1,8 МЛН
Program the ATTINY85 with Arduino 1.8.18 (2022)
7:35
DIY TECH BROS
Рет қаралды 73 М.
DO NOT buy this display, unless...
44:52
upir
Рет қаралды 15 М.
Arduino Basics: Digital And Analog For Input And Output
4:56
MicroMastery Tutorials
Рет қаралды 50 М.
The Big Leak WAS my fault… maybe
24:27
Linus Tech Tips
Рет қаралды 1,3 МЛН
CODESYS || CIROS || SORTING STATION LADDER LOGIC || By Siya
27:04
Nicholas Maibela
Рет қаралды 492
Fading LED With Arduino in Tinkercad
5:39
Autodesk Tinkercad
Рет қаралды 147 М.
How to Make Custom ESP32 Board in 3 Hours | Full Tutorial
2:57:20
Robert Feranec
Рет қаралды 1 МЛН
Arduino in 100 Seconds
2:22
Fireship
Рет қаралды 862 М.