Paul, your enthusiasm for electronics has made me a fan of you
@SamFromSpaceOfficial3 жыл бұрын
Mr. Paul, your tutorials have really helped me to understand and learn Arduino. Your teaching style is like no other. Please keep posting Arduino tutorials!
@elloco999993 жыл бұрын
I always prefer to have the value read "0" when the button is not pressed and "1" when it is pressed so I tried connecting the button to 5V and pin 2 and to write "LOW" to pin 1 to see if that would work as a pull down resistor. And it did :) Thanks for this neat trick Paul!
@MarvPerk33 жыл бұрын
Halfway Home... lesson 34 of 68! Loving learning new tech at my age, 70. Loving coding again, which I did a bunch before I retired. I still don't quite understand how a pull up resistor is introduced by setting an input pin to HIGH... but I'll go back and watch again. That confused me in the last lesson, too, no fault of yours.
@nobleforks8911 Жыл бұрын
Its the same idea as putting the resistor to +5VDC, when the button is pushed it creates a path to ground so pulls the pin low by creating a low impendence circuit to ground.
@jhnmur7 ай бұрын
@@nobleforks8911 Can also use command INPUT_PULLUP
@aynursunagatullin70294 жыл бұрын
Thank you Mr. McWorther, I love this, now it's much easier for me to create pull up switches, also I decided to do a bit of neat formatting, so I added two if functions to say wether my button is on or off in the serial monitor. Here is the code. int buttonPin=12; int buttonVal; int dt =100; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(buttonPin,INPUT); digitalWrite(buttonPin,HIGH); } void loop() { // put your main code here, to run repeatedly: buttonVal=digitalRead(buttonPin); Serial.print("Your button is"); if(buttonVal==1){ Serial.println(" off"); } if(buttonVal==0){ Serial.println(" on"); } delay(dt); }
@malcolmsnow47992 жыл бұрын
BOSC O - I've watched them all - can't wait till you get into interrupts and multitasking. Thanks Mal
@thelocal911 Жыл бұрын
You made me learn pull up and pull down resisters knowing full well, all along, that this existed!?!? Well played, sir.
@autocrosser109 ай бұрын
Watched this one prior to lesson 32. I think it helped to do this before you taught us how to use the joystick. Half way done with the new lessons and I'm still here watching to the end and doing all the math. Your doing something right!
@mikeroerig24994 жыл бұрын
I just finished tutorial 34. I am writing the code for your projects before watching you do it. Thanks for doing these videos. I will utilize an Arduino to control an arcade shooting gallery that was made in 1969. When manufactured, the game was controlled by a custom 8 track tape player. I have been unable to get the tape player to function reliably so I will have an Arduino take over the game control. This shooting gallery was been rescued from the trash and completely restored. An Arduino will allow me to finish this restoration. Your tutorials enable this to happen.
@alanfowler3069 Жыл бұрын
BOSCO, Hi Paul, this is the second time I've followed these tutorials and got to this point. First time stopped due to work commitments, this time determined to see it through until the end. Very new to coding and electronics, but learning all the time. Thanks
@georgeshaiffer22463 жыл бұрын
Thanks, You used this with brief explanation in previous, without mentioning the internal pull up resistor. Much clearer now as to what is going on.
@RockOn611 Жыл бұрын
This tutorial is very helpful for better understanding the 33rd tutorial. Thank you for explaining briefly sir.
@jeffbowyer45763 жыл бұрын
I've played with Arduino for ~1 year. This video is THE MOST IMPORTANT lesson that I've learned. YES, external pull-up resistors are OLD SCHOOL!!! (yet everyone continues to use them)
@daveharkin47315 жыл бұрын
thank you Paul for your time and effort you put into these videos, I really appreciate them. Please keep them coming. When you get the time could you do a video about interrupts and switch, case programming. you seem to be the only person on KZbin I can follow and understand, you teach in an excellent way.
@gilmertugahan11 ай бұрын
The new IDE already has an INPUT_PULLUP feature. I think the IDE you were using doesn't support that. But, it's good to know that it can still work by doing a digitalWrite. It is useful for me because most Arduino micros I've bought doesn't support the new IDE. Thanks so much Sir.
@andrewwilksch Жыл бұрын
A clever man. I'm learning as we go. Some is over my head but I'm getting there. Andy.
@Hino_554 жыл бұрын
Thank you for this tip Sir Paul! I have to agree with the earlier comments, that using the parameter INPUT_PULLUP seems more natural and intuitive as it eliminates the need to write digitalWrite inside the void setup().
@mayankshigaonker77255 жыл бұрын
As far as I know instead of using 2 lines of code for making that pull-up resistor you can use 1 line of coffee that is pinMode(buttonPin, INPUT_PULLUP);
@mightythimble49425 жыл бұрын
No secret word?? Have you gone MAD?? lol this video filled in a very important piece of the puzzle for a project I've been building. Many thanx, Paul! Would love to see a tutorial on shift registers with the kind of detail you put into videos. It's been an real treat to keep up with these.
@rupert31010 ай бұрын
tried it first on my own and got horrible feedback. Your method worked great. good tip.
@billlaird7332 Жыл бұрын
I have become addicted to this series and particularly your teaching style. I understand that you went through the whole push button using pull up and pull down resistors in lesson 33 so that we understood the theory. I really like how you integrate the hardware, software, and physics. I am already looking forward to your raspberry pi series after I finish the arduino.
@paulmcwhorter Жыл бұрын
Wonderful!
@eparizi11 ай бұрын
am I missing something in lesson 33 or you meant lesson 27? I don't see anything about buttons in 33. And I still don't understand why this method works. so far this has been the lesson I struggled most with.
@berryblades2 жыл бұрын
I watched this video about 5 times, love it, please never stop Paul!
@michaelw244014 жыл бұрын
Hardware pull-up or pull-down resistors, this method and INPUT_PULLUP; we have options. I like the idea of using the Arduino internal pull-up because of it's simplicity but I wonder in what applications hard-wired PU resistors may be to our advantage.
@nobleforks8911 Жыл бұрын
Less work for the MCU, INPUT_PULLUP or setting the same pin as INPUT and HIGH at the same time utilizes the limited power output of the board. This is the reason to use resistors; resistors just get rid of stray current(could be generated by as simple as your fingers close to the button or stray EMF in the air) to be grounded.
@muhammadrafiqulislamkhan69942 жыл бұрын
Your every video is very important to me to learn Arduino programming. Thank you.
@peterleitner23833 жыл бұрын
that answers my question from one of the previous videos. Thanks
@TheKverbeeck4 жыл бұрын
That saves some Dupont wires and resistor, very cool indead, we used this trick already for the Joystick push button if i am not mistaking 😀😀😀😀
@richardbritain74352 жыл бұрын
Nice little corner cutting method. Thanks.
@kuravani19635 жыл бұрын
Paul, Thanks for a nice simple understandable tutorial.....
@gilnasty822 жыл бұрын
So much easier this way! And makes complete sense how it works now!! Thanks Paul!!
@wendygrant27352 жыл бұрын
Thanks for this tip to use the Pushbutton Switch.
@naturalfrequencys4283 Жыл бұрын
Paul, This trick helps me greatly in my project. You are amazing...
@erikburman5302 жыл бұрын
I love it that you have to fiddle with the PCB microswitch the same why I do. It seems that they only work marginally well with breadboards.
@andrebedard18165 жыл бұрын
You did that in lesson 32 and I was wondering about doing a digitalWrite to an INPUT device. Now I know why. Thanks
@samwain87139 ай бұрын
Bosco very cool method of checking if people are getting the most out of your videos
@NothingToShoutAbout Жыл бұрын
I’m so grateful for you. You are an amazing teacher.
@rexaustin28854 жыл бұрын
i was going nuts trying to understand why this was done during the joystick code. now it makes sense.
@alirezabayat63889 ай бұрын
hey mr. McWhorter, glad you're still reading comments and before anything i want to thank you for this series, you're an excellent teacher. i have ran into a problem with this technique, if i don't use a resistor and don't do the "original" way of wiring a button, the button value goes up and down by itself and ignores my input. same thing happened with tilt sensor which i fixed it by using a pull up/down resistor. do you have any idea what's going on? i guess it's worth mentioning that i'm using a no-name brand UNO R3, which seems to be working fine everywhere else!
@yasins87134 жыл бұрын
i cant believe that this actually works. thx for showing me this trick and love the tutorials i have learned a lot from you. thank you
@practical_precision_shooters2 жыл бұрын
great tip Paul, really simplifies the use of buttons!
@paulmcwhorter2 жыл бұрын
Glad you liked it
@velingaming71963 жыл бұрын
Epic video Paul! Been testing it out by making a program to let program be run once with 1 click. Having a blast with it! Thanks for your inspiration!!
@paulmcwhorter3 жыл бұрын
Fantastic!
@JonathanDeWitt19884 жыл бұрын
Paul, Thank you for showing us this trick. This was a great video. I just had two quick follow-up questions. 1) Why the heck do we even use pull-up resistors at all? Is it that this trick just isn't known or is it that there are stability issues. Because I noticed you mentioned theoretically that it was stable. 2) Is the internal pull-up resistor internal to the ATMega328P chip or internal to the surrounding circuitry on the Arduino board? I ask because I use the standalone ATMega328P circuitry in a project with a push-button wired up to it. Being able to eliminate a component/installation step with a few lines of code would be great. Granted after watching your series I am considering replacing the pushbutton with a potentiometer to give me finer control on my program.
@takiskard24143 жыл бұрын
Boom, I also programmed internal LED (pin 13) as an indicator to show switch status (saving having to wire external LED/resistor). Works a treat :-)
@jonwebb53953 жыл бұрын
I am in the process of learning how to use Arduino board and love these tutorials. However, while watching this tutorial and reading through the Arduino instructions, it appears there may be a simpler way to write this but I am not sure if it applies here. Instead of instantiating the pinMode as INPUT, can we instead instantiate it as INPUT_PULLUP and then get rid of the need for the digitalWrite(buttonPin, HIGH) line?
@lorisrobots2 жыл бұрын
Yes - that is what I am doing too.
@Musicalcode313 Жыл бұрын
thanks for the insight! less is more =)
@philnewman1110 Жыл бұрын
I aim getting hooked on these tutorials Paul, really enjoying the series, thank you!
@fahimabrar8141 Жыл бұрын
Just realized I am half way through!
@paulrockwell99143 жыл бұрын
Paul, why did you choose to use : pinMode(buttonPin, INPUT); digitalWrite(buttonPin, HIGH); as opposed to. pinMode(buttonPin, INPUT_PULLUP); to set the internal pull-up resistors? (yes, both do the same thing as others have noticed...)
@alanfairclough88792 жыл бұрын
Got it right first time around. Even remembered to set up the serial begin. I feel smarter than shit!
@wallymurray6204 жыл бұрын
Short but informative lesson. Thanks again Paul.
@abdullahmuslim2804 жыл бұрын
This Tutorial is short but informative.
@markfuentes36665 жыл бұрын
Great way to use internal components. Thank a again Paul.
@Azzys0072 жыл бұрын
Hi Paul, I've been watching a few tutorials to help me understand this concept better and I thought I did until I watched this... Does your method without any resistor not short out the supply with ground?
@mikemanny15334 жыл бұрын
Wow...this is a great hack for simplifying the pull up resistor switch scenario. That's three ways I've learnt now...(1) Using the actual external resistor set up...(2) Using this excellent method...........and (3) using the pinMode(buttonPin,INPUT_PULLUP) method. Like the old saying goes..."There's more than one way to skin a cat." I would think that it's real handy to know all three...and there are probably others out there too; I'm sure that given a certain situation, at a more advanced level, each method could come in useful, having that little advantage over the other in that particular application. Thanks again, Paul. Stay safe, mate....and best wishes and regards to yourself and family. Cheers....Grumpy LImey.
@abdallahkhamis8812 жыл бұрын
brilliant !
@derekarruda8823 жыл бұрын
Can you use internal resistor as a pull-down?
@sammysam15034 жыл бұрын
NO SECRET WORD? Its ok Paul, your videos are amazing! Thanks for this tip, it makes push buttons so much easier to make!
@wayneandrews1738 Жыл бұрын
I believe the Arduino site someone mentioned that an internal app. 30k resistance is used. This should prevent arcing switch contacts. Probably the shortest lesson.
@abhik14934 жыл бұрын
Hello Sir, I really love your lessons but would love it and wish we could do advanced stuff like in your first tutorial. I am sure many people would like this as well.
@captainprototype1873 жыл бұрын
Dont you want the button always to read a 1 when it is pressed?
@olegvelichko16595 жыл бұрын
ButtPin... BWAHAHAHAHA!!! Got a good giggle out of that one! Hey, doing a whole video in one shot takes skill! Thank you, sir, for the great content. When’s my next fix coming? This was too little of a dose!
@captaineverythingfun523 жыл бұрын
I was literally thinking the same thing LOL
@angusclarke85922 жыл бұрын
Paul, Where can I get the basic instruction of what the commands mean & the syntax that should be used when compiling a sketch. I'm always confused as to how you just know in what sequence to write your code without breaking stride. I'm always struggling to understand, what tells what to do what & why and what will the outcome of commands be? ?
@thebrewsterblock8 ай бұрын
Another great video. Now I am a bit confused. I have used both this: "pinMode(buttonPin,INPUT);" as per your code or this: "pinMode(buttonPin,INPUT_PULLUP);" both with "digitalWrite(buttonPin,HIGH);". They both work. Don't know the syntax well enough. Is ",INPUT_PULLUP" assumed by just ",'INPUT"?
@DesmondStanulis8 күн бұрын
This video was extremely helpful!
@paulmcwhorter8 күн бұрын
Glad it was helpful!
@riskitall74213 жыл бұрын
Quick question Paul: I was under the assumption that straight volts to a component would make it smoke. Is this only LED's? Why is our button safe without a resistor? Thanks in advance!
@MustafaKaya-vd6pd2 жыл бұрын
INPUT mode activates the pull up resistor that is inside the arduino itself ( 20K ohm ). When you write HIGH to it, and if the button is not pressed, you will be reading 1. When the button is pressed the circuit will be complete and current will be flowing to the ground so the presence of resistor will make the current so low that you will be reading 0.
@Pwyllugh2 жыл бұрын
@@MustafaKaya-vd6pd Thank you for that explanation! I was wondering about this as well
@hawrazahmad94113 жыл бұрын
thanks paul I'm so excited when Watch this lesson.
@aeroakram4 жыл бұрын
Hi Paul, I was just wondering if this does not somehow create a short (i.e. the HIGH signal pin directly connected to GND)? Or does it not create a short because the signal pin is defined as an input to begin with and "HIGH" is just a superficial state?
@favesongslist4 жыл бұрын
Internally it uses a safe high value resistor to pull it up to VCC, so no need to worry. (around 100k ohms) pinMode(pinNum,INPUT_PULLUP);
@richardfeist93403 жыл бұрын
Once again, another great lesson! Simple but very useful. Thank You!!
@paulmcwhorter3 жыл бұрын
Thanks again!
@TheSgrizli3 жыл бұрын
Am I the only one who binge watches these? Day 3 and I'm already at 34...
@rushipadhiyar26153 жыл бұрын
I am with you bro, day 4 and already at 34.
@WhirlwindCK3 жыл бұрын
Indeed; playback speed at 2x, and ready to blaze all the way through in a week.
@zackhenderson23923 жыл бұрын
@@WhirlwindCK 1.5 here, so I can write notes ^.^ Can't wait til I know it all and can start on my project for real
@klaushansen57793 жыл бұрын
Day 3? can you say 2. ups, even tho ive started late yesterday.
@TheBoothParadigm4 ай бұрын
Did you know you can do: PinMode(buttonPin,INPUT_PULLUP); This way you don’t need to do an extra line of digitalWrite(buttonPin, HIGH); in the void setup. Can also do pulldown.
@billglass51603 жыл бұрын
Paul, you anticipated my question about asking why you could do this in the previous videos for the joystick switch. If I correctly understand, the pin2 output driver impedence replaces the 330 Ohm pullup resistor? No reliablity problems in shorting the IC outputs? Thanx.
@handywijaya1111 ай бұрын
Hi Paul,good job. I put a marker at the end of program that on and off the internal led. Sometime my servo get hang while running for a while,and so that the internal led not blink anymore.Any suggest?
@pokerface683 жыл бұрын
No WORD? Please, say hi to Bosco and pet Indigo for me anyway. This was a short and clear lesson, I feel like things are really starting to click now. Thank you once again!
@thomasstenger79513 жыл бұрын
Paul, your videos are absolutely amazing! Thank you sooo much, I have learned gobs. Have you ever made a video where a single button has multiple possible outputs based on how many times the button has been pressed? I am in need of a circuit that reads how many times a single button has been pressed (up to 3 consecutive times) and based on that input performs one of three different functions. Thanks Paul!
@Joker3985 Жыл бұрын
Once again, a wonderful/informative video!! Question, I have been playing with interrupts (both HW & SW) and wonder if this simple way would work with that - so that when you press the button, the interrupt would trigger. Thanks!
@ardinokirzli21894 жыл бұрын
Thank you very much best teacher in the world .
@ahole54072 жыл бұрын
Great videos and all, but I'm just here to find a way to wire simple "up" and "down" buttons to scroll through different led lights on my motorcycle.
@DanielRhoades41222 жыл бұрын
So, when building a project, is this method better than the other method? Also, would this work with the smaller Arduinos (nano, pro mini, etc)?
@andywylie2873 жыл бұрын
Boom!! Thanks for another great tut, Paul.
@nexbedwars74086 ай бұрын
Paul I am not able to fit my switch because the curved leads which are facing each other is lengthier than my breadboard itself(columnwise)!
@bokax19953 жыл бұрын
Another great tutorial! Practical method.
@paulmcwhorter3 жыл бұрын
Glad you liked it
@mohammadalijaffal18762 жыл бұрын
nice arduino tutorials Mr. Paul, please I need your advise in a project, if I want to make a drone using NRF24 what I need to know in the arduino software? thank you
@ReoGizmo5 жыл бұрын
Very nice video. Is it possible to do a PULL-DOWN with just code?
@bearpapa16063 жыл бұрын
I'm just curious is it possible to do this the other way around like "digitalWrite(buttonPin, LOW)", will this cause a short circuit?
@weversonbarbieri89863 жыл бұрын
Paul, you are the best!!
@haastrupadebayoibukun68172 жыл бұрын
Perfect. So the switch was set to be HIGH instead of making another connection to the 5V source. It's obviously more simple and easier.
@sparshgarg79374 жыл бұрын
Hi Paul, I had one doubt that what am I doing wrong if I write, pinMode(buttonPin,OUTPUT); Because the results are similar..
@Tonicwine9994 жыл бұрын
When he says this is just a quick and dirty version what are the disadvantages of doing it this way? Does it damage the circuit in some way?
@Shalfatk013 жыл бұрын
is there any downside of using this technique in terms of hardware problems? shorting circuit or anything like that ?
@pouyanrouzbahani54196 ай бұрын
5:58 We say pull_up next to the INPUT or this. Are there any differences?
@alanpond74868 ай бұрын
BOSCO! Love your tutorials! I recently discovered the 'map' function -might have been useful in this application? :) Ciao!
@nikkitezla33674 жыл бұрын
Made to Bosco and I am also mounting a laser that will be turn on with the joystick.
@pfleischman24714 жыл бұрын
Bosco - Awesome series thank you very much!!
@aaronmilliman76852 жыл бұрын
Great video, maybe Bosco should sell coffee and call it Indigo. :)
@ryandyc7 ай бұрын
How does the Arduino Serial.x library work? How does it do the UART and printing?
@easymac79 Жыл бұрын
This will be very helpful. Is there any downside to this? Does it cause the arduino to heat up more? I presume there is little current carrying capacity, it's just to signal an operation, if you want current, trigger a relay. I guess I wonder why anyone would bother with a seperate resistor if you can write a line of code. I did learn, this evening, why the microswitches always have four leads. I've conducted repairs on small electronics in the past, such as a computer mouse, and wondered why there were four pins on a switch; I already figured out the three pin switches that only use two because it's bulk manufacturing, just use the N/O pins. I need to go back and watch episode/lesson 27. But I think this must* be why the micro push buttons have the four pins, it's not double throw, it's so manufacturers and others can tie a pull up or down resistor to the switch without having to double up on a pin with solder and wire or make the board more complicated.
@ronnieyu75144 жыл бұрын
Hi Paul! I really enjoyed and having a lot of fun with all of your videos. I was wondering if you can make a video of connecting or integrating esp8266 12e module with arduino uno and connecting it with amazon Alexa. Many thanks and more power to you!
@josschrijvers87824 жыл бұрын
Even without a secret word, Thanks a lot, Obrigado!
@gweliver5 жыл бұрын
Paul, very nice follow-up tutorial on something so simple in design, but we need to always do the "MATH", right? "Make America Think Harder", umh? Now to watch the tutorial, more possible comments to follow?
@alexschmidt4371 Жыл бұрын
This is the first video that I watch till the end and have one thing that I am confused about. How are you connecting ground(negative) directly with pin 2 (positive)? To what I know, this should in theory cause problems, but it just works!? I am really confused what I am misunderstanding here :| Edit: Maybe I need to explain a bit. in an alternating current (AC), it you make positive and negative wires connect, you will get a serious problem and should cause things to break if not protected. I know this is Direct current (DC), but isn't it the same concept?
@yadusolparterre4 жыл бұрын
How are you not creating a short when you press that button? VCC connects directly to GRD
@favesongslist4 жыл бұрын
Internally it uses a safe high value resistor to pull it up to VCC, so no need to worry. (around 100k ohms)
@jamieyz4 жыл бұрын
My question too. Thanks for the answer Timothy!!
@rccanuck44734 жыл бұрын
Hi Paul I have an 8 digit 7 segment display with the Max 7219 chip. I want to make it show scoring points on a pinball machine using an arduino Nano or Uno. Not sure if you have something already on one of your videos would require push buttons to change the score preferably one to change ones, another to change tens and another for one hundreds? Any help would be appreciated Maybe even a good course to do if not already Regards Pb
@guilhermedantas32004 жыл бұрын
I do the exact same using the D0 pin in a NodeMCU8266 and the read is 1 at the begining, if press it, it goes to 0, but then if i release the button it stays at 0, why is that?