You have no idea how much you have taught me, thank you brother. I love the way you explain stuff. May God bless you.
@sigmasigma1100015 күн бұрын
eik nx lohas krw uzpisi nx zajibala esi
@davehasakАй бұрын
I'm a part-time engineering instructor, and I'm learning this partially for fun, and partially because I might teach it some day. This is GREAT instruction! Thank you so much.
@azatturegeldin471610 ай бұрын
A brilliant explanation. I was reading a book where I had a similar project with a button and a capacitor. I couldn't implement it properly, and this video helped me a lot!
@Livy296420 сағат бұрын
You are the best teacher ever
@eternitysf341310 ай бұрын
You explained very well! thank you so much!
@aaronjeffery71239 ай бұрын
Your vidios in the ardiuno series are amazing.Keep it up bro
@TehnoVito6 ай бұрын
Great video! All your explanations are slow and matcable. Great job!
@elisedossin6949Ай бұрын
Man this is great stuff
@AayushGupta-uj6hx7 ай бұрын
Bro you explain the best. 👍👍👍
@savithachess11092 ай бұрын
Great work!
@BlobGod2 ай бұрын
Code for people who dont wanna write it void setup () { pinMode(12, OUTPUT) pinMode(2, INPUT) } void loop () { if (digitalRead(2) == HIGH) { digitalWrite(12, HIGH) ; } else{ digitalWrite(12, LOW) ; } }
@AlizxerАй бұрын
for anyone who copied this and got a error, make sure to add a semi-colon at the end of each command under void setup. exa: void setup () { pinMode(12, OUTPUT); pinMode(2,INPUT); }
@CaffineAndCode Жыл бұрын
Amazing explanation
@trivender00710 күн бұрын
Which camera you use for recording.
@ArzenikDev Жыл бұрын
I made it so when pressed green led goes on when not pressed red led goes on
@micahbentley141 Жыл бұрын
How?
@ArzenikDev Жыл бұрын
@@micahbentley141 you use the scripts from first in the if statement and make one go high if pressed and one go low then in the else you make on go low and one go high
@kushalm7328 Жыл бұрын
me too😀
@micahbentley141 Жыл бұрын
nvm, you can make this with no arduino, just a relay. how did I do that?
@tomekpro2918 Жыл бұрын
change line: (digitalRead(button_Pin)==LOW) on this one (digitalRead(button_Pin)==HIGH) - will be ok now.
@ran_ramirez10 ай бұрын
Hello i have a question, how come does my LED is turned on even, i haven't pushed the button, while if i pushed the button, it just glows brighter? i just followed the commands TYIA!
@Science.Buddies10 ай бұрын
You may have the pin set as an input instead of an output - double check that your code AND your circuit follow what is shown in the video.
@Studs_Studio2 ай бұрын
@@Science.Buddies i copied the code and i have the same problem. everything looks like it should work but it still does that. once in a while the led turns off for a second but rarely
@Studs_Studio2 ай бұрын
sorry nevermind. i didnt connect it properly.
@daveluvs3dprinters11 ай бұрын
i love your videos ☺
@spurfy839211 ай бұрын
how did we know if we connect the LED, at the PIN + or a the - one ? Does it will change something ? Or the voltage juste will be inversed ?
@Science.Buddies11 ай бұрын
We recommend watching our video about LEDs before this one, it may answer your questions: kzbin.info/www/bejne/fHzInK2wn5prapYsi=VWlZPUgTYETmyjXP
@farbodkeyhanloo906 Жыл бұрын
This is amazing! Thank you!
@Orcanian666 ай бұрын
Great instruction thanks for sharing.
@cvolii137714 күн бұрын
hey, first of all, thanks dude. But can you maybe explain the system with the 10K resister? I didnt get get you said.
@Science.Buddies14 күн бұрын
We recommend looking up a more detailed tutorial on pull up and pull down resistors, this is more than we can explain in a KZbin comment if you want to know more.
@cvolii137713 күн бұрын
@@Science.Buddies alright, thanks
@cvolii137713 күн бұрын
hey its me again. is it possible to use resistors to connect the leds short head to the ground or must i use a jumperwire?
@Science.Buddies13 күн бұрын
This video might help answer your question: kzbin.info/www/bejne/hIaudWyneriCa5osi=HP9vrJaHQel0FeXs
@ziggyzogginАй бұрын
Great video. the code is needlessly complex though, as you could simplify it to "digitalWrite(led_pin, digitalRead(button_pin));" and I think that's just as readable. though if you add more logic, you do have to make it an if statement. I understand the video is more about teaching programming than actual programming, but I just thought to mention it.
@harishanth.r73210 ай бұрын
What will happen if place the switch on one side? And if we place switch in such a way that the legs are placed on two side.how it gets current or voltage to all legs since the two sides are separated by a plastic? insulator?
@thatphysicsguy785910 ай бұрын
im pretty sure its because the button takes up a lot of space on one side which doesnt allow us to use more wires in the same row(like when he used the resistor and jumper in the same row for the button)
@G18-ROQUEPRECIOUSZOEA.11 ай бұрын
How is it when pushing the buttons to stay on/off? Im having a science project where i need an arduino to control the temperature of my desired heat/cold. Please respond...
@Science.Buddies11 ай бұрын
Hi - if you search online for "Arduino button toggle" you should find example code that lets you push to toggle the button instead of holding it down. You can also look at our list of tutorials and use a slide switch instead of a button.
@Nottm_e7 күн бұрын
Your video is very informative... can you share the code for this project...
@Lucky_Trucky2 жыл бұрын
Suggest another videos with pushbuttons: what about pushing for stay on/off, press short and long, press x times to do this and y times to do that in 5 seconds, ....
@Science.Buddies2 жыл бұрын
Thanks for the suggestion! We will be adding more Arduino tutorials in the future, stay tuned!
@SyntaxError-25059 ай бұрын
I have a question. Can I just make the button let the electricity flow between the LED and the GND-bus? It wouldn't need as much code
@Science.Buddies9 ай бұрын
Hi - if all you want to do is turn on an LED when you hold the button down, then you do not need an Arduino at all. An Arduino allows you to program more complicated behaviors, user other sensors, and control outputs like motors. You can find more information in the Arduino playlist linked in the video description.
@leonardohamdany112324 күн бұрын
thankyou brother
@amirarab2549 ай бұрын
Hello and thank you very much for the great video. Nevertheless I have a question: why do I have to connect the button anyway to the ground. When I don’t push the button, there is no current flow and the input to the PIN is low. Why is the connection to the ground necessary? Than you
@Science.Buddies9 ай бұрын
The connection to ground is needed so the input pin voltage is never "floating" or undetermined. This way it is always either 0V or 5V. If the pin is not connected to anything then it can be affected by electrical noise from other things in the circuit and nearby pins.
@amirarab2549 ай бұрын
Thank you very much
@stevenjenkins9472 ай бұрын
@@Science.Buddiescould you exclude the resistor and just write your code to only be looking for voltage greater than 4? That way if there is a small current leakage it won't cause the led to turn on?
@brewski425castleclash3 ай бұрын
i have watched 3 hours of videos arduinos. yours finally answered my dumb questions. tdlr. a button needs a 5v and and the connection to the pcv. AND it needs a very high resistor to ground or else it short circuits shit. bruh and electricity reads from a ~E. left to right.
@CobraG0012 ай бұрын
could you pls tell me why that high resistor is used?(i am an absolute beginner with Arduino so i dont know any terms)
@brewski425castleclash2 ай бұрын
You still need to complete the circuit but there are random amkunts of tiny current going through due to inperfections. The higj resistor makes sure that off means off. Even the slightest current is supposed to turn the button on. Its just good practice @CobraG001
@satoo27683 ай бұрын
What if want to add a delay in the code, imagine,i want to press the buttom then wait 1 second and the led turns on. But if i keep pressing the button, the led has to turn off until i released the finger and then pressing it again during one sec
@Studs_Studio2 ай бұрын
use delay(miliseconds) before one of the digitalWrites i think
@behem05 Жыл бұрын
what do i need to edit in order to replace the led with variables?
@Science.Buddies Жыл бұрын
If you watch to the end of the video (starting around 16:20) we cover using variables in the code.
@kiwi-ne2cg23 күн бұрын
i dont know what went wrong here, but the lightbulb only lights up when the "green" wire is lifted up...
@mila-ko30364 ай бұрын
Does it work with Mega 2560? (it is unofficial Arduino, but almost the same)
@sentakatsukiАй бұрын
yes
@SgtDangerWaffles9 ай бұрын
im not sure if this is right but it worked for me insted of == i put a single - and it does the same this.
@Science.Buddies9 ай бұрын
== is called a "comparison operator" and a single = is called an "assignment operator" - you can learn more about this in the Arduino language reference: www.arduino.cc/reference/en/
@marvelqueen528 ай бұрын
It worked in tinkercard but it didn't work in real life
@tutorialtime4036 ай бұрын
Did you find a way to fix it?
@just_sayin82085 ай бұрын
I looked through the code and he forgot to add the "if (digitalRead(2) == HIGH)
@justin.4204 ай бұрын
First step is to get a life
@ChaksFM4 ай бұрын
@@justin.420piss off
@farham5652 ай бұрын
@@justin.420 Get lost bro ppl actually make money with this shi u need to get a life and learn something
@voscapattern8 ай бұрын
thank uu
@mila-ko30364 ай бұрын
The code he showed in the video doesn't work for me for some reason, but here is working code for anyone like me: // C++ code // void setup() { pinMode(12,OUTPUT); pinMode(2,INPUT); } void loop() { if(digitalRead(2) == HIGH) digitalWrite(12,HIGH); else digitalWrite(12,LOW); }
@fredcormier91497 күн бұрын
you literally saved our lives in class thank you we were going to fail
@ИгорьБакуринский5 ай бұрын
This code doesnt work. .....could not convert 'digitalWrite(12, 1)' from 'void' to 'bool. How to FIX????
@voxelcatt4 ай бұрын
its digitalWrite(12, HIGH)
@veniaminvigovsky8 күн бұрын
unfortunately it doesn't work for me for some reason, I doublechecked everything connection-wise, but it doesn't work. The LED just blinks from time to time, I don't know what's wrong... maybe the button is wrong, idk..
@veniaminvigovsky8 күн бұрын
the LED turns on even without 5v cabel connection
@veniaminvigovsky8 күн бұрын
ok so the prblem was that my button was connected to a separate power bus
@rrssmooth664311 ай бұрын
gee I wish when people write the code, they make it bigger to be able to see the code.
@Ra6771YT19 күн бұрын
14:21
@__KursK__9 ай бұрын
Couldnt you just use the button as an circuit breaker instead of using code? Seems simpler but the code one is cooler
@Science.Buddies9 ай бұрын
Yes, if all you want is on/off control of a single LED using a button, then technically you do not need the Arduino at all, but if you want to do anything more complicated (like making multiple LEDs flash in a pattern when you push a button once) then it becomes much easier to do with code.
@__KursK__9 ай бұрын
@@Science.Buddies Yeah, that's true. Even through, you might be able to do it with like logic Gates or relais
@Science.Buddies9 ай бұрын
Right - you can hard-wire plenty of interesting circuit behaviors without any code at all. For example, check out the "Bluebot" series of projects on our site, which have both Arduino and non-Arduino versions. The non-Arduino versions can do basic left-right steering using different sensor inputs despite not having any microcontroller: www.sciencebuddies.org/science-fair-projects/science-projects?s=bluebot
@coreyworthington87866 ай бұрын
It’s not working for me
@sandipkr.sarkar58134 ай бұрын
Why you need Arduino for this
@junixec3 ай бұрын
It's not that you need Arduino for that but Arduino can do a lot of stuff including that, you can use a push button to light a bulb, nothing more, nothing less, but in Arduino you may use the same push button to trigger an event like turns your bulb on and off with just one button press which a regular push button cannot do unless you push it on and off continuously. You may also use the same push button with Arduino to dim your Led or Brighten your Led which a regular push button cannot do. I hope this helps.
@N1ghtR1der66625 күн бұрын
I know I am in a minority here but I have never understood why people would want to learn another language to make a program (sudo code) when the languages are mostly in plane english anyway, I find sudo code much harder to write than actual code
@sen80785 ай бұрын
why this button so big lmao goofy aah button
@Studs_Studio2 ай бұрын
Youve never seen a slightly larger button before?
@RJkatztabby7 ай бұрын
I copied the code and it won't compile. This is bullshit!
@tutorialtime4036 ай бұрын
Did you find a way to fix it?
@Book9999-x4z11 ай бұрын
It doesn't work
@123nody11 ай бұрын
Same for me
@123nody11 ай бұрын
it works on the tinkercad sim, but on the board it doesn't. I debugged it but still nothing
@sadhgunavarshinie728110 ай бұрын
Check the other vid about debugging arduino in this playlist
@IplayGames24seven9 ай бұрын
I dont have a PC 😡
@Science.Buddies9 ай бұрын
You can also program an Arduino from a Mac! See the software options here: www.arduino.cc/en/software
@bimbo-yw6ny7 ай бұрын
but if arduino output is only 250mamps, what's the point to use all these resistors, currrent is limited, and the board is suppose has a resistor to stop overflow of current back to the pin? i've tried without resistors, nothing bad happens, the board is still working.
@bimbo-yw6ny7 ай бұрын
why the 10kohms resistor??
@bimbo-yw6ny7 ай бұрын
i'm sorry i followed the video, i got the explanation, not to short the 5v to the pin with a 10k resistor.