Arduino for Beginners: Using Push button to turn ON LED light

Поділитися
Вставка
  • Опубліковано 9 лют 2025
  • This is absolute beginners Arduino tutorial showing how to use push button to turn ON an LED light.
    Download the code:
    robojax.com/lea...
    Get standard 10pcs PCBs for free
    robojax.com/L/?...
    See example of H-Bridge project here • Building H-Bridge Moto...
    The software used to draw tth diagram is a free program called Fritzing which you can get it from fritzing.org
    Secrete Amazon Deals:
    Visit and purchase via my Amazon Store: amzn.to/3zL00id this will help me. thank you
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Get early access to my videos via Patreon and have your name mentioned at end of very videos I publish on UA-cam here: robojax.com/L/?... (watch until end of this video to list of my Patrons)
    ****************************
    If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robo...
    If you want to learn Arduino from proven instructor on **Udemy**: bit.ly/rj-udemy
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/lea...
    #robojax #robojax_push_button

КОМЕНТАРІ • 49

  • @letsgotatertots
    @letsgotatertots 2 місяці тому

    I have watched some other tutorials of different aspects but this one was the easiest you just earned yourself a Sub!

    • @robojax
      @robojax  2 місяці тому

      Thanks for subbing. Then you must whatch this video to know why you must user a resistors with the push buttons ua-cam.com/video/TTqoKcpIWkQ/v-deo.html

  • @scottpreston6197
    @scottpreston6197 6 років тому +1

    Great tutorial! Thanks. I've watched a bunch for leds, buttons, and this one was by far the easiest to follow and provided the best results. I swapped out hard coding pin numbers for variables declared at the beginning (int BUTTON = #; and int LED = #;), but otherwise, followed it exactly and got the intended results.

    • @robojax
      @robojax  6 років тому

      You are welcome.

  • @Napoleonrevolution
    @Napoleonrevolution 7 місяців тому +2

    Watching 1 tutorial is less boring compared to 12 years of education

  • @einnaanne
    @einnaanne 9 місяців тому

    thank you very much! you just helped me finished my assignment!

  • @MVP11489
    @MVP11489 6 років тому +1

    This is extremely helpful! I'm just getting into arduino and you explaining the hardware AND programing is awesome! I'm watching through your other videos now. One question I do have, is how do you determine which resistor to use for the LED? What would happen if you try to run without the resistor, would it fry the LED, or arduino, or even both? Thanks :)

    • @robojax
      @robojax  6 років тому +1

      You are welcome. I have a video exactly explaining how to calculate resistor value for LED here ua-cam.com/video/x2YxfV1L02Y/v-deo.html

  • @avocadogaming5008
    @avocadogaming5008 5 років тому +3

    3:56
    the software you use to connect the cables

    • @robojax
      @robojax  5 років тому +1

      I watched the video and it has been mentioned in the video (watch it again). I just added the link in the description.

  • @jackree7781
    @jackree7781 10 місяців тому

    Tried to add this to an already existing project, but it doesn't seem to work, so I'm probably doing something wrong. So far, I used an ultrasonic sensor and a micro servo to open a door. I'm trying to add this led which lights up when I press a button. When it's lit up, I want a buzzer to make a sound whenever someone tries to open the door, and when it's not lit up, the door opens normally. Problem is: nothing happens to my led.

    • @robojax
      @robojax  10 місяців тому

      when you combine two codes into one, pay attention to pin definition. for example in your first project if pin 3 is used, then when adding second project, you can use the same pin3. use different pin and pay attention toi variables. if you are not getting erro, then it means either pin difination (pinMode(13, INPUT)) have conflect or wrong or wiring is incorrect. Make sure you to test them separately and they work before combining them. good luck

  • @adilabusafa
    @adilabusafa Рік тому +1

    أهلاً وسهلاً ومرحباً بك-يتعذر التعليق-لا أعلم .

  • @Greybic
    @Greybic 2 роки тому

    Awesome 👌

  • @Mannsy83
    @Mannsy83 6 років тому +2

    hey mate good video but my led is constantly on and the pushing the switch does nothing..any ideas?

    • @robojax
      @robojax  6 років тому +1

      check your wiring. Make sure you copy the code and past it into arduino. It should work.

    • @Mannsy83
      @Mannsy83 6 років тому

      Thanks buddy

  • @koffamatildadiamond7914
    @koffamatildadiamond7914 3 роки тому

    Can you please show how to do this using Proteus

    • @robojax
      @robojax  3 роки тому

      The software you mentioned is never used in any industry or educational institutions. It is very expensive and just for rich people. We are here to support ordinary people. Like free software

  • @riteshlama6780
    @riteshlama6780 5 років тому +1

    Can U tell me how to switch it on automatically with just the program and no manual work required?

    • @robojax
      @robojax  5 років тому

      so you want the LED to turn ON and OFF?It is called blink. Very simple. On Arduino program click on File->Examples-Basic-Blink and you have that.

  • @vedkaal
    @vedkaal 7 років тому

    Grt work sir..

    • @robojax
      @robojax  7 років тому

      Thank you Sir.

  • @tomalen5616
    @tomalen5616 4 роки тому +1

    it doesn't work. I followed the video precisely...

    • @robojax
      @robojax  4 роки тому +2

      doesn't work is not enough. what do you see? if error, then please provide. explain so I can help you.

  • @filiperpg
    @filiperpg 6 років тому

    Thank you Sir!

    • @robojax
      @robojax  6 років тому

      You are welcome.

  • @tokitahmid6641
    @tokitahmid6641 4 роки тому

    thanks

    • @robojax
      @robojax  4 роки тому

      You are welcome. Thank you for not skipping the ads and keep watching them. This will help me a lot.

  • @jaojaopineda5361
    @jaojaopineda5361 4 роки тому

    hi sir can you make a LED Blinking If the push button pressed ..If the button pressed again the LED Stop Blinking..pls. tnx..

    • @robojax
      @robojax  4 роки тому

      Interesting project. I just add it to my list. i will make video God willing. It needs writing and experimenting.

  • @magmagth4346
    @magmagth4346 2 роки тому

    Many thanks
    I have a text file stored in sd memory as follows, it consists of three columns
    0'10,0
    10,0,0
    0,0,10
    0,0,0
    10,0,0
    ..
    I have three LEDs connected to three terminals (pins) of the Arduino, for example 7,8,9
    How do I get a code that enables the Arduino UNO to read the text file and convert each number 10 to 5 volts on one of the three pins
    Thus, it will light three LEDs sequentially according to the data stored in the SD card memory. Thank you very much

    • @robojax
      @robojax  2 роки тому

      Hello, I have a full tutorial on MicroSD card module here ua-cam.com/video/TduSOX6CMr4/v-deo.html which is free. but if you want custom code, I will do it if you compensate my time. I will charge $100 for this. if you are interested, please contact me via robojax.com contact page.

  • @alexgreen3630
    @alexgreen3630 6 років тому

    Thanks very much :)

    • @robojax
      @robojax  6 років тому

      you are welcome.

  • @qwer2yy2rewq_74
    @qwer2yy2rewq_74 5 років тому

    can u do this without a breadboard?

    • @robojax
      @robojax  5 років тому

      yes you can solder the wires and do it. breadboard is just holding it and making it easy.

  • @Kailey_Neher
    @Kailey_Neher 5 місяців тому

    My LED just wont stop constantly glowing I followed the tutorial step by step. Anybody know why?

    • @robojax
      @robojax  5 місяців тому

      I assume you took the code from the resource page here robojax.com/learn/arduino/?vid=robojax-pushButton if so, then the the pin 2 is always LOW to turn ON the LED. then it means your push button has 4 wires and you gotta rotate it 90 degrees so the correct pins are in place. Good luck. try and reply .

    • @Kailey_Neher
      @Kailey_Neher 5 місяців тому +1

      @@robojax Oh my gosh rotating it worked. I've literally followed so many tutorials on this and couldn't figure out why it was constantly emitting light. Thank you so much!!

    • @robojax
      @robojax  5 місяців тому

      You are welcome. I am glad it worked.

    • @robojax
      @robojax  5 місяців тому

      if you get the long two pin type push button, you won't make mistake www.amazon.ca/dp/B0BBPZ2TYD?th=1

  • @mesheep123
    @mesheep123 5 років тому

    i did everything, and it does not work!!!! Please help robojax!!!!

    • @robojax
      @robojax  5 років тому

      you must have escaped. Please watch the video fully without escaping. I can assure you it will work if you have the components.

  • @handiinu2.077
    @handiinu2.077 6 років тому

    it doesnt work for me :(((

    • @robojax
      @robojax  6 років тому

      You must be doing something wrong. Watch the video again. Do not fast forward. Watch everything.

    • @andrewtworow6300
      @andrewtworow6300 6 років тому

      than your board must be dead or fried

  • @kyranclaeys3972
    @kyranclaeys3972 9 днів тому

    I have 6pins haha