Establishing communication... Arduino and Marraige Counseling..(8:30)...Lines of communication.. Sending and Receiving Information. What a great course!
I agree with Nikolai... No one every bothered to explain things the way you do. The circus example for libraries sent it home for me...Thanks so much Jeff
Let me say from the bottom of my heart. This is one of the best learning experiences in my life. I should say this is a good course for newbies like me. Thanks a lot.
For those of you who don't know, the resistor is placed there to prevent short circuits and to allow current flow to PIN 2. Let me elaborate... when the button is not being pressed, there is no current flow since the closed circuit has no voltage being applied over it. When you click the button, a voltage appears. Now this voltage has 2 paths it can take. 1 is towards the ground (where the resistor is connected) and one is towards PIN 2. You need to remember that the PIN 2 path is also connected to a ground eventually (very important to remember) and when the path reaches ground, the current will have passed through resistors themselves. So in theory we have 2 resistors (1 is the 10K Omega resistor seen, and the other is within the micro-controller). So current will have passed through both paths (through the pass of the Resistor and the path of PIN 2), meaning your micro-controller will be able to sense the change in current (which is the whole idea). Now if the resistor was not placed, since electricity looks for the path of least resistance, all of the current would just go directly to the ground connection since the path has less resistance than the PIN 2 Path. So in that case the circuit would not work, and you would have created a short circuit which could destroy your electronic device. If your not sure what a short circuit is, It would be wize to look it up.
Also, I assume that the voltage that passes by both the resistors (1st one being the 10K Omega resistor and the 2nd one being the micro-controller), since the setup does resemble a parallel circuit and resistors in a parallel circuit experience the same voltage while experiencing different currents.
Marko V I still dont get it. If the resistor would not be placed there, then current would only flow through pin 2, right? - presumed the button is pressed. Then the microcontroller can detect current. If the button is unpressed, there is no current flowing anywhere, so the microcontroller can't detect current. My point is, to me it seems the resistor placed there is redundand... what am I getting wrong?
Marko V actually from my understanding its a "pull down resistor". it prevents fluctuation in the high/low state of the pin, drawing any ambient current in the pin to ground when the button is not pressed, but provides less resistance to the pin than to ground when pressed resulting in a high/on state. apparently there is electrical energy in the air that can mess with your low voltage projects.
EXCELLENT ! First reply to the resistor question that actually "clicked" for me. I know my paraphrased summary below is riddled with noobness but is this it in a nutshell ?? The resistor is there for when the button is NOT pressed, in case any minuscule stray voltage has "leaked" into pin 2 while its just sitting there, making it a tiny bit more than zero. Once the button IS pressed, the current will go through the pin 2 part of the circuit because it's easier than taking ( what looks like to me) the "short circuit" the resistor is now making.
"Now if the resistor was not placed, since electricity looks for the path of least resistance, all of the current would just go directly to the ground connection since the path has less resistance than the PIN 2 Path. So in that case the circuit would not work, and you would have created a short circuit . . ." Actually, if the resistor were not placed, there would be no path, and NO current would go to the ground connection. This would be an OPEN circuit, which is of course the exact opposite of a short circuit.
Your videos are incredibly well done and helpful. After almost a year of not doing this, these videos helped me get back into the swing of things. Major props to you!
I can't thank you enough for freely sharing your knowledge and experience on this subject. I'm just getting started and it's a bit intimidating at times. But lessons like yours really make a difference. Thank you my friend, keep up the good work!
Thank you for doing this series. I had been struggling with Arduino for a while, that is until I started watching your videos. I wasted a lot of time looking around online and getting bad advice or the projects were too advanced to be of benefit. I even took a couple Arduino classes that were offered and paid for through work. They were not half as good as your tutorials. I am learning so much now. You keep things at a good pace, explain just enough to complete a main idea, your code works well (unlike some I have found online), and you keep it light and entertaining. I have already recommended you to a friend and will send more your way. Keep rocking it.
i tried lots of videos to learn this.............now this realy helped me........anyone with basic c can learn adruinom from these videos thank u soo uch
You are awesome programmer very clear explanation. I been searching for a simple code but no matter what I do I can’t successfully complete it. 2 LED WILL ALTERNATE BY PUSH OF ONE BUTTON USING ARDUINO. That while holding the button down #1 led will be on, when you release the button #1 led will be off, but when you press and hold the button again #2 led will be on and when you release the button again led #2 will be off. Then repeat.
Thanks Eduardo - you're to kind! I'll see what I can do for a video on that setup! Sounds like you need some code to... • track button presses • track button releases • You'll definitely want to make sure the button is debounced • depending on the count, you'll want to turn on the LED when the button is down - maybe like checking if the count is even or odd...
Wow !! That will be awesome. I looked everywhere nothing setup this way ,this will be different led for all my Collection. Most of them stay on even button is release.
Other have said it and I'll repeat it< You are an awesome instructor! I've taken courses all of my adult life, online active, online passive like this, in person and by mail (yeah Im that old) . You presentation skills are exemplary and the details of the slides and screen captures are synchronized well and are relevant, easy to see and complete. There is very little on the internet I am willing to pay for and even less on TH-cam , making this a true Golden Unicorn of content. Thank You...and Thank You again.
To be honest I've been trying to start working with Arduino for a very long time. I have a project in mind and I just didnt know where to start. But your tutorials really encouraged me to start. Simply because you speak clearly, quick enough but not too quick, and finally because the videos and codes are just so organised and clear. Sometimes such simple things make all the difference in the world. I have subscribed and I wish you keep them coming 😁
Hey man, I love to hear your explanations, very wide and meticulous. I've learn a little bit at school about Visual Basic and its language but I got a lot of problems to retain the information and use it. Now with you explanations, I'm able to understand and use this programing language. Thank you so much for all the pacience in you videos and the good explanations. I'm going to build a steering wheel with the Arduino Uno and add you channel for every one that wants to do what I'm going to do, to learn from you! Wish you were my teacher in high school!
Definitely, his teaching style of being calm and repetitive but informative is working for me, havent coded anything in years, since basic and qbasic lol. Needed this to break into arduinos. Thanks
THANK YOU SO MUCH, your videos are outstanding, I am just a freshman in high school and I can understand your videos to help me learn to code. These are the best videos online by far.
Thanks Austin! Sio glad they are helping! We also have an "Arduino in 90 Minutes" video that might be helpful: th-cam.com/video/BLrHTHUjPuw/w-d-xo.html Best of luck!!
I'm really enjoying your videos, they are full of information, organizing the info in my head, straight to the point, they are understandable and the most important thing is IT"S NOT BORING. :) Thank you man keep uploading. :)
Incredible vides. I'm a Software Engineer, and I really appreciate your detailed description and explanation of what's going on from a hardware perspective. Wish I would have taken a few E.E. courses back in school but your tutorials have expanded my knowledge base tremendously.Thanks.
"...In one line of code you're pretty much your way to dominating the world" Good tutorials, still waiting on my arduino ultimate kit in the mail so i can execute world domination
Man, You're very cool. I like the way you talk. "Conquering the world" lol. That's how I felt when I wrote the blink programming on my own, based on your past tutorial. Greatings from a Brazilian, studying in Germany and currently taking his semester abroad in Barcelona, attending Fab-Academy_2016.
I bought the starter kit from the Arduino store. It's a great kit, but the included tutorials advance too quickly for someone like me with limited knowledge. Your tutorials are a great supplement, as they break down the details in a way that the kit book does not. I hope you keep making these, thanks!
Great vid. What I don't understand at 3:28 : Why would we need a resistor for a current going back into the arduino? We apparently don't need one for the INPUT going back to pin 2, so why would we need one for GND?
THANKS!! I really appreciate the attention to detail here. Still tough to get into this stuff, but you made is much more understandable. "in one line of code you're pretty much on your way to dominating the world" ~ Programming Electronics Academy
They are the best tutorials I've seen, they are very clear and didactic. I hope that they continue easy to understand when we have more difficult examples to learn Arduino programming. Thank you very much.
These are brilliant. I'm watching them before I've got myself an arduino and now I can't fucking wait to get my hands on one. The possibilities seem endless.
It's truly helpful for CS students without knowledge about EE stuffs like me to get started with Arduino. Thks a lot ! I have just bought a course about arduino on udemy, but it far worst than yours.
To whoever doesn't have the breadboard and wants to use ONLY arduino, you can define pinMode(pushButton, INPUT_PULLUP); instead of how it is in the video as just INPUT and you will only need a wire to connect one side to the ground (on arduino is written as GND) and the other side to the pin, in this case pin 2. Atmeg micro-controller from Arduino board itself has inside implemented a resistor that's why you won't even need one. p.s. it's nice to try as a lazy alternative hehe
Thank you very much for your amazing good video and description. I have a question concerning minute 4:17 Why is this not a short circuit? There is no load in this circuit. Thank you for your help
Thank you man. It seems to be a good work. I am starting to watch your videos by now, but its very good content here. I will try to have MATLAB Simulink working with arduino. But 1st things 1st, so I need your tutorials. Good job here man. Thank you again.
why did I buy that stupid book getting started with arduino, when I've learned more from you for nutn, the least I can do is rate, comment, and subscribe. thanks mike
You never want to have an input "floating" (Could lead to unreliable readings of the input), which it would be if the Arduino-side of the pushbutton isnt connected to 0 V (ground) when depressed. If you dont have a resistor, you would shortcuircuit the 5V & ground when pressing the button. To avoid "floating inputs", you just need a very tiny current, so a 10 KOhm resistor is perfectly fine. Hope this explains the function of the resistor :-) Just seen it also was explained by Terah 6 mth ago :-D
It wont "see" the resistor in any way..Its a digital input, so either 0 or 1 (5V). When button not pressed, the voltage on input is 0V, held down, but without anything but like a few microamps beeing used to hold it to 0 V. When button pressed, input gets 5V straight. But resistor itself is not seen by the Arduino..Except that if it was not there, you could get some irratic results.
Thank you so much for the great tutorials! This video brings up one of the hardest things for me to grasp in electronics. As you say in the video, "Pin 2 sees zero volts". I have figured out that this is the reason for the resistor. However, I can't figure out how it works. Zero is "nothing", so how can Pin 2 "see" or "read" nothing? If you can explain that, I'm sure it would go a long way in helping me and a lot of others understand electronics. Thanks. Regards.
I've been trying to figure out the purpose of the resistor in the circuit. I think I figured it out, remembering something from my science class. Doesn't electricity flow in the path of least resistance? so by setting two paths, one closed all the time but with resistance and the other that can be open or closed, you change the direction of the electricity, is that right? its just to control the flow of electricity?
the resistor is there to limit the current that the arduino has to move/flow, remember the arduino can only flow about 40 milliamps. you will hear the term "being pulled high or low". here in this schematic it is being pulled low, to ground, if it where high it would be to 5 volts or whatever the Vcc or power supply is. when pulled low the arduino will sense a ground at pin 2, with that information the arduino can know what is happening in the circuit. hope that helps mike
@@snaprollinpitts5 years later but I'm fiddling with a mega 2560, and was curious of this as well. So essentially, the resistor is to limit the current to
A couple of questions here - First, why do you not make pushButton a constant, since its value should never change during execution? Second, would it not be better to declare the buttonState variable in the setup function, and only do assignment in the loop function?
Great questions Brett. For the first one, your are right, the programmer definitely could have made pushButton a constant. Why he/she chose not to do this I am not sure. On the second one, I also agree. I think part of the reason this approach was used is because the Examples that come with the Arduino IDE are meant to be basic in nature (usually). And for a beginner, seeing the variable buttonState declared when it is first used may make it easier to understand that you must declare a variable before you use one. This of course is pure conjecture. Not much of an answer but the best I can come up with...Have a good one!
Open Source Hardware Group Totally makes sense. I am really interested in the electronics side of things, so your tutorials are very helpful. My questions are from the programmer's side of my brain. I am sure I will have more as I get into building stuff.
if your a extra noob like me and after this tutorial you find your read is irratic check to see if your bread board is not split into sections, the arduino digital read will do that if not connected to ground this is normal.
Great video!! I have one question: In your circuit diagram you have the blue jumper set to pin 2. Wouldn't the current just ignore that path and go straight to GND? Also what is the point of the resistor if ground is zero? I just bought the Arduino today and I don't have a clue about any of this, so forgive me if this question makes no sense.
also be warned that if you are using the 1 and 2 pins for other things, the serial monitoring uses those pins so it can cause confusion, i could not figure out why 2 leds on my project were illuminated constantly , but found when i commented out serial begin, it worked as intended
Hey mate, thanks for the video's. They've been great to watch however, I thought I had broken something! I was using digitalRead from a pin which had no variable attached and no voltage HIGH/LOW being sent to and yet it was triggering my pin 13 LED to light up! It was a neighbouring pin and despite many a head-scratch, I couldn't figure out why a neighbouring/unused pin was still activating my LED. So I discovered a capacitance issue whereby the nearby circuitry, atmosphere, finger tips etc can still trigger a HIGH state. No doubt you're aware? So yeah, I broked it but now I force a LOW state on this pin and it's all fine now. No errant LED lighting :)
Sis I am a new to arduino.i have started to learn it through you but after the blink example I have done the next example through an android app it was showing an upload error I don't know what happened please help me please
Great tutorial 07 digital read. I have done two challenges too. Q.. Do I need to wipe the old sketch before I load a new one ? For example blink LED is sitting in the Uno working away happily, then I load a new sketch over it .I guess the original sketch is over written with the new one . Q is it wise to cover the bottom of the Arduino Uno as it looks like all the pins from the PCB are exposed ,it could short out... Great job Dave
Hi David dave , Thanks for watching and for posting great questions. Q1: When you load the new sketch, the old one is overwritten - nothing more you need to do. Q2: I agree with your observation, though I can't say I have ever had any issues, and have never covered the bottom. I normally do work on a wood desk and I do my best to keep my work area clean. Thanks again!
Since the pin codes are 1 and 0 for high and low respectively... you made us understand that we use the "int" data type. but why dont we use the "boolean" type since its 1 bit to save storage
Nice Video, How do you get past : void loop() ? The program gets in the loop, and there's no way out.. How do I do something else while the led is blinking. ?
Such a good question Thomas! To answer your question, you never get out of the loop - it is an infinite loop. To add other functionality, you introduce other control structures into the program, like if statements, for loops, while loops, switch case, and start using interrupt driven code and timers (e.g., you start using millis() for timing of events)
Can you comment on why you need a resistor on the input to the push button tied to down? Same question really on why you need a resistor in front of the LED?
+Mark Bernard Hi Mark - the resistor for the button is to make sure the button state isn't 'floating', which, in case of an LED, can cause erratic blinking. By grounding it via a resistor you ensure that the input reads 0 volt (and not, as can happen when you're running power through multiple components, a low but random voltage). For the LED. the resistor limits the current running through the LED. The way LED's work, as semiconductors/diodes, a small change in voltage can have a big effect on current. The resistor is to make sure both the board and the LED won't be blown up if something unexpected in the voltage happens. This is just Google and my understanding of this matter speaking, so if anyone has a better answer, don't hesitate to jump in :P (Although here is the resistor-with-the-button answer: www.arduino.cc/en/Tutorial/DigitalReadSerial)
I'm learning as well, but I believe the reason you need a resistor for the LED is because that particular LED can only handle a certain amount of Amps (20 milliamps, or 20mA I believe) or else it will break. As for the resistor here, I'd love a more detailed explanation from the video creator.
would it be because the pin is always sending current to the pushbutton and when the pushbutton is depressed current will take the path of least resistance (through the pushbutton circuit) ?? thats the way i see it not certain tho
i have a resistor that have 5 bands. 10k Ohms and 220 Ohms ( i don't know if i am reading it right because its looks the same from both sides ) but they have 1% ( that what the calculator is showing ) can i use it?
Ok so I tried doing this without looking at the video and it was annoying me that the test light stayed on so I wrote a blink sketch very quickly. It is pretty much exactly what is in the example code. But now my problem is that lets say the code to print the value of my button input is in the beginning of my code, I have to wait until the program reaches that point. I guess I could re-write the code in between lines of code but that doesn't seem like good practice since that would definitely make things run slower on more complicated programs. Is there a way to blink a light without halting any other code?
Wouldn't it be better to declare the buttonState variable in the setup function. By including it in the Loop function , the variable is being declared and initialised over and over each time the program loops.
Okay, ChipMIK somewhat answered this, but it seems unclear. So I'll ask it in a different way: When the Button is depressed, how much of the 5V goes to pin 2, and how much is lost trying to go to Ground through the 10k resistor? What if it was a 500 Ohm resistor?
i did everything exactly the same but when reading on serial monitor, it reacts to vicinity of my hand! I don't even touch the button , when i put my hand close to the board it changes value?! i tried moving components on the breadboard and i get the same result. I thought at first I connected some kind of weird photo resistor but no, switch provided in starter kit. Any ideas?
I am having some trouble here, would you tell me why the serial monitor is not showing 0 or 1? I made the exact same circuit but still doesn't show anything.😢
Love your videos!! I have one question. What is the purpose of the resistor in this circuit. It doesn't appear to be doing anything? I'm not very circuit savvy though so I'm probably missing something.
Firstly, thank you, great tutorials! So I'm trying to continue from this basic sketch and add an 'if' statement as below.. (tried both above and below the println line) if (buttonState = 1){ digitalWrite(LED, HIGH); } else{ digitalWrite(LED, LOW); Note: 'LED' is a variable, on pin 8 and set as an output. The LED isn't turning on and off as the switch is being pressed. I wanted to see if i could control an LED without the current flowing directly to the LED via the switch (i.e. off a different pin on the Uno). Anyone know whats going on here? is this possible with Arduino?
ahhhhh! the satisfaction of working through this and working things out yourself :) I was trying to work this out for about 3 hours by moving curly brackets, double checking IF statements etc. before giving up and posting a comment. After covering tutorial 10 I figured i should have been using == as = is used to assign values. ....ahhh, the joys of learning!!! Thanks again for the great tutorials. i will visit the site to continue on from number 10 for sure!!
"hope thats as clear as mud"!!! around 14:42 minutes LOL. How about "I hope thats as clear as water". Only joking!!! This a wonderful series thanks for all your efforts. :-)
oh my..you're great! i got a new arduino uno, and all that programming language is so confusing to me.. I'm learning so fast hahaha still at the beginning tho. (What is the difference, maybe in voltage, in applying a resistor to the cathode or to the anode of an LED?)
Hey, this is unrelated but I'm trying to code an ATtiny85 with my arduino uno. When I enter in "Avrdude -c usbtiny -p attiny85 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m" for the fuse it says AVRdude does not name a type.
Great tutorial-series, but there is one thing that made me wondering. If the button is NOT prest the circuit starts at pin 2 and end in ground. BUT, when the butten is prest, the circuit starts at 5V and end right in pin 2? Is this really possible to start and stop a circuit in a pin, or is it just my mind playing tricks on me? grts Arofnogneu
Great question, arofnog neu Internally, Pin 2 eventually is connected to ground, so current will flow from the 5 volt pin to pin 2 and to ground. It is also worth noting that when the button it pressed, some current will also be flowing through the 10k resistor to ground. Hope this helps some.
Yes, it made it more clear, but if Pin 2 is internally connected to ground, why would it flow through resistors or LEDs? Doesn't electricity looks for the quickest way to ground? (I'm a programmer not an electrician :D )
+Programming Electronics Academy Could you elaborate on the need for that resistor? Why does some of the current need to get to ground that way, instead of thru pin2? Also why does it have to be a resistor, instead of just a wire to ground? Awesome series so far!
the first challenge at the end (changing serial.println to serial.print) makes.... the data on the serial monitor just become a bunch of squares. what am I supposed to learn from this? and the second challenge (changing it to pin 3) does nothing at all. (my io3 pin is on the rx pin)
+Mike Dellink So if the resistor was replaced by a conductor then pressing the button would just allow electricity to flow tot the quickest route to ground?
ok so i break the gnd circuit,even then everything works almost same except that in the serial monitor the transition b/w 0 and 1 takes a bit more time than before ? appreciate ur help
****If you like this, I think you'll like the premium Arduino training we offer. You can check it out here**** bit.ly/3lHyzcB
To the one who put out these tutorials your patience and clarity is outstanding. Thank You for taking the time toward sharing these videos.
ryan scripter Thanks for being so kind!
Establishing communication... Arduino and Marraige Counseling..(8:30)...Lines of communication.. Sending and Receiving Information. What a great course!
Thanks! Glad you like it!
I agree with Nikolai... No one every bothered to explain things the way you do. The circus example for libraries sent it home for me...Thanks so much Jeff
You are so much better than my teacher at college!
+Nikolai Markovic I am not so sure...but thanks for watching!
It's true...you are better than my college teacher as well!
Let me say from the bottom of my heart. This is one of the best learning experiences in my life. I should say this is a good course for newbies like me. Thanks a lot.
Best line. "i know you have an insatiable desire to understand all things in the universe" lol
great tutorials!
For those of you who don't know, the resistor is placed there to prevent short circuits and to allow current flow to PIN 2. Let me elaborate... when the button is not being pressed, there is no current flow since the closed circuit has no voltage being applied over it. When you click the button, a voltage appears. Now this voltage has 2 paths it can take. 1 is towards the ground (where the resistor is connected) and one is towards PIN 2. You need to remember that the PIN 2 path is also connected to a ground eventually (very important to remember) and when the path reaches ground, the current will have passed through resistors themselves. So in theory we have 2 resistors (1 is the 10K Omega resistor seen, and the other is within the micro-controller). So current will have passed through both paths (through the pass of the Resistor and the path of PIN 2), meaning your micro-controller will be able to sense the change in current (which is the whole idea). Now if the resistor was not placed, since electricity looks for the path of least resistance, all of the current would just go directly to the ground connection since the path has less resistance than the PIN 2 Path. So in that case the circuit would not work, and you would have created a short circuit which could destroy your electronic device. If your not sure what a short circuit is, It would be wize to look it up.
Also, I assume that the voltage that passes by both the resistors (1st one being the 10K Omega resistor and the 2nd one being the micro-controller), since the setup does resemble a parallel circuit and resistors in a parallel circuit experience the same voltage while experiencing different currents.
Marko V
I still dont get it. If the resistor would not be placed there, then current would only flow through pin 2, right? - presumed the button is pressed. Then the microcontroller can detect current. If the button is unpressed, there is no current flowing anywhere, so the microcontroller can't detect current.
My point is, to me it seems the resistor placed there is redundand... what am I getting wrong?
Marko V actually from my understanding its a "pull down resistor". it prevents fluctuation in the high/low state of the pin, drawing any ambient current in the pin to ground when the button is not pressed, but provides less resistance to the pin than to ground when pressed resulting in a high/on state. apparently there is electrical energy in the air that can mess with your low voltage projects.
EXCELLENT ! First reply to the resistor question that actually "clicked" for me.
I know my paraphrased summary below is riddled with noobness but is this it in a nutshell ??
The resistor is there for when the button is NOT pressed, in case any minuscule stray voltage has "leaked" into pin 2 while its just sitting there, making it a tiny bit more than zero.
Once the button IS pressed, the current will go through the pin 2 part of the circuit because it's easier than taking ( what looks like to me) the "short circuit" the resistor is now making.
"Now if the resistor was not placed, since electricity looks for the path
of least resistance, all of the current would just go directly to the
ground connection since the path has less resistance than the PIN 2
Path. So in that case the circuit would not work, and you would have
created a short circuit . . ."
Actually, if the resistor were not placed, there would be no path, and NO current would go to the ground connection. This would be an OPEN circuit, which is of course the exact opposite of a short circuit.
Your videos are incredibly well done and helpful. After almost a year of not doing this, these videos helped me get back into the swing of things. Major props to you!
I've looked at a lot of tutorials and by far yours is the most helpful in growing knowledge not just regurgitating facts.
Chris Bingham Thanks a ton!
I can't thank you enough for freely sharing your knowledge and experience on this subject. I'm just getting started and it's a bit intimidating at times. But lessons like yours really make a difference. Thank you my friend, keep up the good work!
Thanks! Best of luck Chris.
Thank you for doing this series. I had been struggling with Arduino for a while, that is until I started watching your videos. I wasted a lot of time looking around online and getting bad advice or the projects were too advanced to be of benefit. I even took a couple Arduino classes that were offered and paid for through work. They were not half as good as your tutorials. I am learning so much now. You keep things at a good pace, explain just enough to complete a main idea, your code works well (unlike some I have found online), and you keep it light and entertaining. I have already recommended you to a friend and will send more your way. Keep rocking it.
Craig King Thanks a ton - you are too kind! I will keep doing my best.
Dude, you are an awesome teacher, this series has helped me understand a topic I had no knowledge of. Thank you. I'm continuing to follow the series.
+livinlifefishin Thanks for watching!
i tried lots of videos to learn this.............now this realy helped me........anyone with basic c can learn adruinom from these videos thank u soo uch
You are the Rob Ross of arduino
ross bob
Boss Rob
Lol
You are awesome programmer very clear explanation.
I been searching for a simple code but no matter what I do I can’t successfully complete it.
2 LED WILL ALTERNATE BY PUSH OF ONE BUTTON USING ARDUINO.
That while holding the button down #1 led will be on, when you release the button #1 led will be off, but when you press and hold the button again #2 led will be on and when you release the button again led #2 will be off. Then repeat.
Thanks Eduardo - you're to kind!
I'll see what I can do for a video on that setup!
Sounds like you need some code to...
• track button presses
• track button releases
• You'll definitely want to make sure the button is debounced
• depending on the count, you'll want to turn on the LED when the button is down - maybe like checking if the count is even or odd...
Wow !! That will be awesome. I looked everywhere nothing setup this way ,this will be different led for all my Collection. Most of them stay on even button is release.
@@programmingelectronics is this really possible?
Who keeps down voting these videos. They are by far the best I’ve come across! Thanks for being on team human.
Go Team Human!
Other have said it and I'll repeat it<
You are an awesome instructor!
I've taken courses all of my adult life, online active, online passive like this, in person and by mail (yeah Im that old) . You presentation skills are exemplary and the details of the slides and screen captures are synchronized well and are relevant, easy to see and complete. There is very little on the internet I am willing to pay for and even less on TH-cam , making this a true Golden Unicorn of content.
Thank You...and Thank You again.
P.S.
Just visited the PEA site and saw the paid content subscriptions. Are you the presenter and is the format the same as these??
Wow, you are too kind thank you!
Yes, the paid subscription continues the curriculum, pretty much the same format throughout. Thanks for the interest and have a great one.
I really understand arduino now because of your deeper explanation and you are better than my teacher in arduino.
Definitely the best explanation I’ve ever heard// good job mate:)
To be honest I've been trying to start working with Arduino for a very long time. I have a project in mind and I just didnt know where to start. But your tutorials really encouraged me to start. Simply because you speak clearly, quick enough but not too quick, and finally because the videos and codes are just so organised and clear. Sometimes such simple things make all the difference in the world. I have subscribed and I wish you keep them coming 😁
Another excellent lesson. I completed the challenges easily. I have no hesitation in recommending this channel, thank you.
Thanks for the kinds words Tony.
Thank You for exellent Tutorials
Hey man, I love to hear your explanations, very wide and meticulous. I've learn a little bit at school about Visual Basic and its language but I got a lot of problems to retain the information and use it. Now with you explanations, I'm able to understand and use this programing language. Thank you so much for all the pacience in you videos and the good explanations. I'm going to build a steering wheel with the Arduino Uno and add you channel for every one that wants to do what I'm going to do, to learn from you! Wish you were my teacher in high school!
Thank you so much for these tutorials. You have made the complex, uncomplex.
Definitely, his teaching style of being calm and repetitive but informative is working for me, havent coded anything in years, since basic and qbasic lol. Needed this to break into arduinos. Thanks
THANK YOU SO MUCH, your videos are outstanding, I am just a freshman in high school and I can understand your videos to help me learn to code. These are the best videos online by far.
Thanks Austin! Sio glad they are helping! We also have an "Arduino in 90 Minutes" video that might be helpful:
th-cam.com/video/BLrHTHUjPuw/w-d-xo.html
Best of luck!!
I've truly started understanding arduino and how it works thanks to you! you're doing a great jobbbbbb
I'm really enjoying your videos, they are full of information, organizing the info in my head, straight to the point, they are understandable and the most important thing is IT"S NOT BORING. :)
Thank you man keep uploading. :)
+Muhammad Yousef Thanks for the kind words and insights! I appreciate you watching.
Great videos! i'm a mechanical engineer, and i can't get around the fact that i need to start coding. These videos make it a lot easier. Thanks!
+Davinci611 Glad they can help and thanks for watching!
watched a few of these lessons, got hooked and just ordered a arduino . Looking forward to trying them out and learning something new.
Incredible vides. I'm a Software Engineer, and I really appreciate your detailed description and explanation of what's going on from a hardware perspective. Wish I would have taken a few E.E. courses back in school but your tutorials have expanded my knowledge base tremendously.Thanks.
"...In one line of code you're pretty much your way to dominating the world"
Good tutorials, still waiting on my arduino ultimate kit in the mail so i can execute world domination
I love your explanations. They are so clear and easy to understand. I really appreciate this series!
Man, You're very cool. I like the way you talk.
"Conquering the world" lol. That's how I felt when I wrote the blink programming on my own, based on your past tutorial.
Greatings from a Brazilian, studying in Germany and currently taking his semester abroad in Barcelona, attending Fab-Academy_2016.
Sounds like fun +Luiz Henrique, thanks for your kind words!
I bought the starter kit from the Arduino store. It's a great kit, but the included tutorials advance too quickly for someone like me with limited knowledge. Your tutorials are a great supplement, as they break down the details in a way that the kit book does not. I hope you keep making these, thanks!
Great vid.
What I don't understand at 3:28 :
Why would we need a resistor for a current going back into the arduino? We apparently don't need one for the INPUT going back to pin 2, so why would we need one for GND?
THANKS!! I really appreciate the attention to detail here. Still tough to get into this stuff, but you made is much more understandable.
"in one line of code you're pretty much on your way to dominating the world" ~ Programming Electronics Academy
They are the best tutorials I've seen, they are very clear and didactic.
I hope that they continue easy to understand when we have more difficult examples to learn Arduino programming. Thank you very much.
These are brilliant. I'm watching them before I've got myself an arduino and now I can't fucking wait to get my hands on one. The possibilities seem endless.
It's truly helpful for CS students without knowledge about EE stuffs like me to get started with Arduino. Thks a lot ! I have just bought a course about arduino on udemy, but it far worst than yours.
speak like a true Professor !! no BS straight to the point!! thank you for the awesome tutorial
To whoever doesn't have the breadboard and wants to use ONLY arduino, you can define pinMode(pushButton, INPUT_PULLUP); instead of how it is in the video as just INPUT and you will only need a wire to connect one side to the ground (on arduino is written as GND) and the other side to the pin, in this case pin 2. Atmeg micro-controller from Arduino board itself has inside implemented a resistor that's why you won't even need one.
p.s. it's nice to try as a lazy alternative hehe
Thanks for adding that!
@@programmingelectronics np, but thank YOU for these really high quality explanations and videos!
Thank you very much for your amazing good video and description.
I have a question concerning minute 4:17
Why is this not a short circuit? There is no load in this circuit.
Thank you for your help
You are amazing!!! You've got awesome teaching skills!!! Keep it up!!!
Thanks for the kind words Ganesh!
What a incredible series!
Thanks - if there are some others you would like to see let me know.
The best Tutorial man👍👍
A really nice of you to share your knowledge in this platform.
Keep sharing more videos so that we get good exposure to Arduino ;)
Thank you man. It seems to be a good work. I am starting to watch your videos by now, but its very good content here. I will try to have MATLAB Simulink working with arduino. But 1st things 1st, so I need your tutorials. Good job here man. Thank you again.
8:33 sounds like experience talking. I feel you brother.
why did I buy that stupid book getting started with arduino, when I've learned more from you for nutn, the least I can do is rate, comment, and subscribe. thanks mike
Dude your awesome. I am learning ALOT. but quick question...why use a resistor? Whats the simple logic that is behind that.
-YK
That's my question as well, i'm kind of noob in electronics, but your courses teach me very much.
You never want to have an input "floating" (Could lead to unreliable readings of the input), which it would be if the Arduino-side of the pushbutton isnt connected to 0 V (ground) when depressed. If you dont have a resistor, you would shortcuircuit the 5V & ground when pressing the button. To avoid "floating inputs", you just need a very tiny current, so a 10 KOhm resistor is perfectly fine. Hope this explains the function of the resistor :-)
Just seen it also was explained by Terah 6 mth ago :-D
Oh, okay. Didn't see his reaction. So the Arduino will just see it as well with a very small current?
It wont "see" the resistor in any way..Its a digital input, so either 0 or 1 (5V). When button not pressed, the voltage on input is 0V, held down, but without anything but like a few microamps beeing used to hold it to 0 V. When button pressed, input gets 5V straight. But resistor itself is not seen by the Arduino..Except that if it was not there, you could get some irratic results.
Actually arduino is reading the voltage drop across the resistor; if there is no resistor there will be no voltage drop thus no reading :-)
Thank you so much for the great tutorials! This video brings up one of the hardest things for me to grasp in electronics. As you say in the video, "Pin 2 sees zero volts". I have figured out that this is the reason for the resistor. However, I can't figure out how it works. Zero is "nothing", so how can Pin 2 "see" or "read" nothing? If you can explain that, I'm sure it would go a long way in helping me and a lot of others understand electronics. Thanks. Regards.
I've been trying to figure out the purpose of the resistor in the circuit. I think I figured it out, remembering something from my science class. Doesn't electricity flow in the path of least resistance? so by setting two paths, one closed all the time but with resistance and the other that can be open or closed, you change the direction of the electricity, is that right? its just to control the flow of electricity?
Flyerminer You are definitely on the right track!
the resistor is there to limit the current that the arduino has to move/flow, remember the arduino can only flow about
40 milliamps. you will hear the term "being pulled high or low". here in this schematic it is being pulled low, to ground, if it where high it would be to 5 volts or whatever the Vcc or power supply is. when pulled low the arduino will sense a ground at pin 2, with that information the arduino can know what is happening in the circuit. hope that helps mike
thank you!
No, the dark side is the path of least resistance
@@snaprollinpitts5 years later but I'm fiddling with a mega 2560, and was curious of this as well. So essentially, the resistor is to limit the current to
This is an excellent series. I can fully recommend it. Thanks
A couple of questions here - First, why do you not make pushButton a constant, since its value should never change during execution? Second, would it not be better to declare the buttonState variable in the setup function, and only do assignment in the loop function?
Great questions Brett. For the first one, your are right, the programmer definitely could have made pushButton a constant. Why he/she chose not to do this I am not sure.
On the second one, I also agree. I think part of the reason this approach was used is because the Examples that come with the Arduino IDE are meant to be basic in nature (usually). And for a beginner, seeing the variable buttonState declared when it is first used may make it easier to understand that you must declare a variable before you use one.
This of course is pure conjecture. Not much of an answer but the best I can come up with...Have a good one!
Open Source Hardware Group Totally makes sense. I am really interested in the electronics side of things, so your tutorials are very helpful. My questions are from the programmer's side of my brain. I am sure I will have more as I get into building stuff.
Thank you so much for your videos. This is exactly what I need to learn about Arduino!
I wish I can help people like you do...thank you so much
if your a extra noob like me and after this tutorial you find your read is irratic check to see if your bread board is not split into sections, the arduino digital read will do that if not connected to ground this is normal.
Great video!!
I have one question: In your circuit diagram you have the blue jumper set to pin 2. Wouldn't the current just ignore that path and go straight to GND? Also what is the point of the resistor if ground is zero?
I just bought the Arduino today and I don't have a clue about any of this, so forgive me if this question makes no sense.
also be warned that if you are using the 1 and 2 pins for other things, the serial monitoring uses those pins so it can cause confusion, i could not figure out why 2 leds on my project were illuminated constantly , but found when i commented out serial begin, it worked as intended
Excellent course, the resistor in this case is called a pull down resistor
Really love your tutorials and thnx for teaching this really cool info!
Thanks for watching!
Thank you for taking the time. This was well done.
You explain things beautifully! Thank you so much!
Hey mate, thanks for the video's. They've been great to watch however, I thought I had broken something!
I was using digitalRead from a pin which had no variable attached and no voltage HIGH/LOW being sent to and yet it was triggering my pin 13 LED to light up! It was a neighbouring pin and despite many a head-scratch, I couldn't figure out why a neighbouring/unused pin was still activating my LED. So I discovered a capacitance issue whereby the nearby circuitry, atmosphere, finger tips etc can still trigger a HIGH state. No doubt you're aware?
So yeah, I broked it but now I force a LOW state on this pin and it's all fine now. No errant LED lighting :)
My program doesn't gets upload to the arduino
Thank you. I did not know about the need for the pull-up resistor.
Sis I am a new to arduino.i have started to learn it through you but after the blink example I have done the next example through an android app it was showing an upload error I don't know what happened please help me please
Can someone please explain (4:26) why is that when the button is pressed the current is not flowing back to ground?
Please check out the configuration of the bread board and how it works it might solve your question .cheers !
I'm learning so much so fast!
Great tutorial 07 digital read. I have done two challenges too.
Q.. Do I need to wipe the old sketch before I load a new one ? For example blink LED is sitting in the Uno working away happily, then I load a new sketch over it .I guess the original sketch is over written with the new one .
Q is it wise to cover the bottom of the Arduino Uno as it looks like all the pins from the PCB are exposed ,it could short out...
Great job
Dave
Hi David dave , Thanks for watching and for posting great questions.
Q1: When you load the new sketch, the old one is overwritten - nothing more you need to do.
Q2: I agree with your observation, though I can't say I have ever had any issues, and have never covered the bottom. I normally do work on a wood desk and I do my best to keep my work area clean.
Thanks again!
Since the pin codes are 1 and 0 for high and low respectively... you made us understand that we use the "int" data type. but why dont we use the "boolean" type since its 1 bit to save storage
Hi. Thank you for sharing these tutorials. I'm happy you made them :)
Nice Video,
How do you get past : void loop() ? The program gets in the loop, and there's no way out.. How do I do something else while the led is blinking. ?
Such a good question Thomas! To answer your question, you never get out of the loop - it is an infinite loop.
To add other functionality, you introduce other control structures into the program, like if statements, for loops, while loops, switch case, and start using interrupt driven code and timers (e.g., you start using millis() for timing of events)
Can you comment on why you need a resistor on the input to the push button tied to down? Same question really on why you need a resistor in front of the LED?
+Mark Bernard Hi Mark - the resistor for the button is to make sure the button state isn't 'floating', which, in case of an LED, can cause erratic blinking. By grounding it via a resistor you ensure that the input reads 0 volt (and not, as can happen when you're running power through multiple components, a low but random voltage).
For the LED. the resistor limits the current running through the LED. The way LED's work, as semiconductors/diodes, a small change in voltage can have a big effect on current. The resistor is to make sure both the board and the LED won't be blown up if something unexpected in the voltage happens.
This is just Google and my understanding of this matter speaking, so if anyone has a better answer, don't hesitate to jump in :P
(Although here is the resistor-with-the-button answer: www.arduino.cc/en/Tutorial/DigitalReadSerial)
I'm learning as well, but I believe the reason you need a resistor for the LED is because that particular LED can only handle a certain amount of Amps (20 milliamps, or 20mA I believe) or else it will break. As for the resistor here, I'd love a more detailed explanation from the video creator.
would it be because the pin is always sending current to the pushbutton and when the pushbutton is depressed current will take the path of least resistance (through the pushbutton circuit) ?? thats the way i see it not certain tho
i have a resistor that have 5 bands.
10k Ohms and 220 Ohms ( i don't know if i am reading it right because its looks the same from both sides ) but they have 1% ( that what the calculator is showing ) can i use it?
why did you connect pushbutton to digital pin not to analog pin.
your reply will help me for better understanding, thank you.
Is it possible to replace the pushbutton with a blinking LED? And what will be the changes in the codes?
Ok so I tried doing this without looking at the video and it was annoying me that the test light stayed on so I wrote a blink sketch very quickly. It is pretty much exactly what is in the example code. But now my problem is that lets say the code to print the value of my button input is in the beginning of my code, I have to wait until the program reaches that point. I guess I could re-write the code in between lines of code but that doesn't seem like good practice since that would definitely make things run slower on more complicated programs.
Is there a way to blink a light without halting any other code?
Wouldn't it be better to declare the buttonState variable in the setup function. By including it in the Loop function , the variable is being declared and initialised over and over each time the program loops.
your videos are really nice!! But I wanted to know what does the resistor do here, and can u please provide the link as to why we used 9600 bits
Okay, ChipMIK somewhat answered this, but it seems unclear. So I'll ask it in a different way: When the Button is depressed, how much of the 5V goes to pin 2, and how much is lost trying to go to Ground through the 10k resistor? What if it was a 500 Ohm resistor?
i did everything exactly the same but when reading on serial monitor, it reacts to vicinity of my hand! I don't even touch the button , when i put my hand close to the board it changes value?! i tried moving components on the breadboard and i get the same result. I thought at first I connected some kind of weird photo resistor but no, switch provided in starter kit. Any ideas?
I am having some trouble here, would you tell me why the serial monitor is not showing 0 or 1? I made the exact same circuit but still doesn't show anything.😢
Thanks for these videos!
How do you turn off a function/sketch?
You are awesome!
A question, Why the 10K resistor?
Why can't I just directly connect it to GND??
Love your videos!! I have one question. What is the purpose of the resistor in this circuit. It doesn't appear to be doing anything? I'm not very circuit savvy though so I'm probably missing something.
So if i get it right the resistor is there because if it was not current would rather flow to ground then pin 2 ? (after pressing button)
You are great in teaching
Firstly, thank you, great tutorials!
So I'm trying to continue from this basic sketch and add an 'if' statement as below.. (tried both above and below the println line)
if (buttonState = 1){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
Note: 'LED' is a variable, on pin 8 and set as an output. The LED isn't turning on and off as the switch is being pressed.
I wanted to see if i could control an LED without the current flowing directly to the LED via the switch (i.e. off a different pin on the Uno).
Anyone know whats going on here? is this possible with Arduino?
ahhhhh! the satisfaction of working through this and working things out yourself :)
I was trying to work this out for about 3 hours by moving curly brackets, double checking IF statements etc. before giving up and posting a comment.
After covering tutorial 10 I figured i should have been using == as = is used to assign values.
....ahhh, the joys of learning!!! Thanks again for the great tutorials. i will visit the site to continue on from number 10 for sure!!
Sukhvinder Sahdra Awesome work!
Sukhvinder Sahdra :)
Sukhvinder Sahdra Or you can just "if (buttonState > 0)" also works. Nice Job!
"hope thats as clear as mud"!!! around 14:42 minutes LOL. How about "I hope thats as clear as water". Only joking!!! This a wonderful series thanks for all your efforts. :-)
Glad you are liking them Pierce! Thanks for the kind words.
oh my..you're great! i got a new arduino uno, and all that programming language is so confusing to me.. I'm learning so fast hahaha still at the beginning tho. (What is the difference, maybe in voltage, in applying a resistor to the cathode or to the anode of an LED?)
Hey, this is unrelated but I'm trying to code an ATtiny85 with my arduino uno. When I enter in "Avrdude -c usbtiny -p attiny85 -U lfuse:w:0xfe:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m" for the fuse it says AVRdude does not name a type.
Great tutorial-series, but there is one thing that made me wondering. If the button is NOT prest the circuit starts at pin 2 and end in ground. BUT, when the butten is prest, the circuit starts at 5V and end right in pin 2?
Is this really possible to start and stop a circuit in a pin, or is it just my mind playing tricks on me?
grts Arofnogneu
Great question, arofnog neu Internally, Pin 2 eventually is connected to ground, so current will flow from the 5 volt pin to pin 2 and to ground. It is also worth noting that when the button it pressed, some current will also be flowing through the 10k resistor to ground.
Hope this helps some.
Yes, it made it more clear, but if Pin 2 is internally connected to ground, why would it flow through resistors or LEDs? Doesn't electricity looks for the quickest way to ground?
(I'm a programmer not an electrician :D )
+Programming Electronics Academy
Could you elaborate on the need for that resistor? Why does some of the current need to get to ground that way, instead of thru pin2? Also why does it have to be a resistor, instead of just a wire to ground? Awesome series so far!
What is the purpose of the resistor in this project.
the first challenge at the end (changing serial.println to serial.print) makes.... the data on the serial monitor just become a bunch of squares. what am I supposed to learn from this?
and the second challenge (changing it to pin 3) does nothing at all. (my io3 pin is on the rx pin)
does it have to be a 10k resistor only or can I use a smaller one? I have a 4.7k one and I don't want to fry my board or anything
It's appears that the 5v does now flow through the resistor when the button is pushed? Please explain the resistor. Thanks for this great lesson!
You know that electricity always want to take the easy way out? Pushing the button creates a easier way to flow
+Mike Dellink So if the resistor was replaced by a conductor then pressing the button would just allow electricity to flow tot the quickest route to ground?
i really love you sir you teach me alot of things
ok so i break the gnd circuit,even then everything works almost same except that in the serial monitor the transition b/w 0 and 1 takes a bit more time than before ?
appreciate ur help