YouTube home Comedy Week on YouTube
Upload

Tutorial 02 for Arduino: Buttons, PWM, and Functions

sciguy14 sciguy14·100 videos
37,388
288,344
Like     Dislike 42

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to like sciguy14's video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to dislike sciguy14's video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to add sciguy14's video to your playlist.

Uploaded on Jan 10, 2011

New Episodes each Monday!

You can download the parts list and the code from this episode on my website:
http://jeremyblum.com/2011/01/10/ardu...

This tutorial series is sponsored by element14. Check out their arduino group!
http://www.element-14.com/community/g...

Follow me on twitter: http://www.twitter.com/sciguy14

Loading icon Loading...

Loading icon Loading...

Loading icon Loading...

The interactive transcript could not be loaded.

Loading icon Loading...

Loading icon Loading...

Ratings have been disabled for this video.
Rating is available when the video has been rented.
This feature is not available right now. Please try again later.

Top Comments

  • André Marín García

    The only thing i don't understand is the use for the first resistor, the one u use on minute 4:15 :(

    can someone explain it again?

    · 8

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate André Marín García's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate André Marín García's comment.
  • Cameron Belt

    You want the signal from the button to be low when it is not pushed but you also want to create a high signal that goes from the power into the arduino input pin to do this you connect a resistor of large resistance. it "drains" any voltage to ground keeping it low when the button is inactive and when it is pushed most of the current(thats why a large one is needed) flows into the input pin and not back into ground that the resistor is connected to. hopefully that makes some sense

    · 4

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Cameron Belt's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Cameron Belt's comment.
    in reply to André Marín García (Show the comment)

Video Responses


All Comments (493)

Sign in now to post a comment!
  • jaredanwyl

    Figured it out.

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jaredanwyl's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jaredanwyl's comment.
  • jaredanwyl

    I'm having a weird issue. My switches (in all examples) seem to be always on. I can use a wire and inserting it acting like a switch works correctly. When i use a switch pressing the button does nothing. (basically current is already flowing) Therefore its acting like a wire and not allowing me to use it like a switch, any ideas?

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jaredanwyl's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jaredanwyl's comment.
  • RebalanceGaming

    You don't "really" need it. But basically it makes sure that there is NO current flowing through the button until it is pressed. i'm not too sure why it is there either, because there shouldn't be any "leakage" of power through the switch....

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate RebalanceGaming's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate RebalanceGaming's comment.
    in reply to André Marín García (Show the comment)
  • Wade Hawkins

    I'm really confused by how the ledOn variable was set with a default value of "false" instead of "low"? Can we use the terms "false" and "low" interchangeably? That wasn't stated in the tutorial.

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Wade Hawkins's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Wade Hawkins's comment.
  • Leinad581

    i was so confused as the led was already turned on, and when i pressed the switch the led turned off, i went onto the arduino.cc website and i got the code and the code from there worked perfectly, i found out that it didnt work at first is because ive got the unr r3 the newest version and you have got the uno r2 at least thats what i think happened)

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Leinad581's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Leinad581's comment.
  • sebomstian

    He explains that very nicely in the next part of this series.

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate sebomstian's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate sebomstian's comment.
    in reply to André Marín García (Show the comment)
  • Chris Schmitz

    Every class, like setup and loop are in this case, has to specify whether it is void, or whether it returns a variable, like, say, an int- classes can be called upon/run by other classes, and the return type of the class that's called upon has to match the context in which it is called. Hope that makes sense.

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Chris Schmitz's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Chris Schmitz's comment.
    in reply to Spawnicorn (Show the comment)
  • rdang16

    dude. you are awesome. thanks for the vids

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate rdang16's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate rdang16's comment.
  • dsrjth

    is it possible to use this code for multiple buttons? if yes how?

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate dsrjth's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate dsrjth's comment.
  • Loading comment...
Loading...
Advertisement

Suggestions

Loading...
Working...
Sign in to add this to Watch Later