Arduino Tutorial 02: Buttons and PWM

preview_player
Показать описание

Welcome to the second Arduino Tutorial from our Arduino Tutorial Series. In this tutorial we will learn how the Digital Input and Output pins work and we will make few examples using Buttons and LEDs. Also we will learn what is PWM (Pulse Width Modulation) and make examples for controlling the LED brightness using PWM.

Like my page on Facebook:

Add me on Google+:
Рекомендации по теме
Комментарии
Автор

i hope you got the problem sorted out before you teach. you have great video but i cant get past the uhhhh every other word.

dancopeland
Автор

you would make a great teacher thanks a lot for all your videos

talktomesek
Автор

Finally, someone writes and explains the code. Comment for the algorithm.👍

woowocgwhwrehvcb
Автор

2nd example's modified code:
int led=11;
int button=12;
int buttonstate=0;
int brightness=0;
int fade=5;
int i=0;
void setup(){
pinMode(led, OUTPUT);
pinMode(button, INPUT);
}
void loop(){
analogWrite(led, brightness);


delay(1000);
}
if(buttonstate==HIGH){
brightness=brightness+fade;

fade=-fade;
i=i+1;
}
}
if(buttonstate==LOW){
brightness=0;
fade=5;
i=0;
}
delay(30);

}

uditgoel
Автор

Bro! Simmer down on the “uh” otherwise great video

thomasnelson
Автор

Hi, thank you for your great Arduino-tutorials, they help a lot to understand that stuff.

I have a question regarding the code of the second example shown in your video: The brightness-value is set to zero at the start of the script. The loop will add 2 each time, so the if-statement "if (brightness == 255)" can never be true, because the integer-value "brightness" jumps from 254 to 256. But it works and I try to find out, why?

jorgwagner
Автор

Whats ground wire is working at 8:48??

priyanksisodia
Автор

Very good tutorials. In this video you did not explain the presence of the resistor, I think it's pullup/pulldown one

batticha
Автор

Please make more Arduino tutorials. Thank you.

lynarith
Автор

your videos are one of the best out there <3 <3 <3. the amount of effort you put in to explain these concepts are exceptional

vickyveera
Автор

for those who using arduino uno, pin number 13 is not a pwm, i sugest to use pin number 11 for the led

fadhilfirdausi
Автор

The schematic is incorrect due to ground. The black wire should be ground but you have connect them to 5 volts.

matthewlam
Автор

I'm really enjoying learning through your tutorials. Very clear and insightful. Thank you for your outstanding content ! ... 🇬🇧

doverivermedia
Автор

black line from button and led should connect to ground, but your image was not correct, was it? (0.52-1.20 min)

pongcmu
Автор

The button code is not working for me. The previous one with the blinking light worked, but with this one, the light stays on regardless of the button for some reason. I tried it myself and copying your code in from the site, as well. Not sure what's wrong?

edit: it was the lack of a drop-down resistor when I did my button circuit.

DanielYusim
Автор

I want to control speed of a DC motor having inbuilt encoder. Can this be done by writing a code in MATLAB ?can you please give me some hints ?

UtsavShah_iitgn
Автор

you are great engineer thank you my friend

alimahmoud
Автор

Hi Dejan, Great videos on Arduino.
I am just learning Arduinos and find these tutorials a great help.
Question, could you do one on using the "I2C" connections, I have a 20x4 LCD with the small I2C interface board but I cannot get the display to show anything.
Saciba.
Kevin.

sparcnz
Автор

Anyone know why 225 is selected? Thank you

junkiing
Автор

Your teaching method and videos are great but just that number of ' uhh ' that you say very often must be reduced. Thank You...

bueissa