Using Momentary Switches on the PICO

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มิ.ย. 2022
  • Learn how to interface Momentary Switches to the RPi Pico and learn how to make the switch behave the way you want it to! Momentary switches are VERY commonly used in many applications with microcontrollers and this video will help you understand them extensively. Covered in this video:
    * What is a Momentary Switch
    * That they are used for
    * Datasheet Review
    * Fritzing wiring diagram
    * Dealing with Key bounce effectively
    * How to define their behavior with FIVE program examples
    SEE ASSOCIATED VIDEOS:
    Raspberry Pi PICO Setup and Preparation for Programming • Raspberry Pi PICO Setu...
    Using PWM on the RPi PICO microcontroller • Using PWM on the RPi P...
    PICO Machine Library PIN Class • PICO Machine Library P...
    Using PICO Interrupts • Using PICO Interrupts
    VISIT OUR COMPANION WEBSITE -- makingstuffwithchrisdehut.com
    DOWNLOAD FILES HERE -- makingstuffwithchrisdehut.com...
    SOURCED ITEMS USED IN SOME OF THE VIDEOS
    25 pcs Momentary Switch assortment amzn.to/3uR6BRG
    10 pcs Seven Segment LED display amzn.to/37lv21R
    2 pcs Bar Graph LEDs amzn.to/3LIevno
    3 pack of breadboards amzn.to/3oAkK3H
    200 pc assortment of LEDs amzn.to/3JfLQVc
    450 pc assortment of LEDs amzn.to/3sr1vKL
    38 value / 1200 pcs resistor assortment amzn.to/3Llxq8k
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 30

  • @nigelworwood8530
    @nigelworwood8530 7 หลายเดือนก่อน

    I came back for a refresher. So consider a second like. Thanks for sharing your knowledge.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  7 หลายเดือนก่อน

      Hi Nigel,
      It is truly my pleasure to share what little I know with great people such as yourself. I sure hope it helps you with your exploration of PICO and MicroPython!
      Cheers!
      Chris

  • @user-nk5vc9ot6l
    @user-nk5vc9ot6l 7 หลายเดือนก่อน

    You deserve a bigger following
    Keep it up
    you and Paul Mcwhorter are amongst the best teachers

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  7 หลายเดือนก่อน

      Hi user-nk5vc9ot6l,
      THANK YOU VERY MUCH!!!! That is a wonderful compliment and I really appreciate it.
      Cheers!
      Chris

  • @Doug-Didgiridoo
    @Doug-Didgiridoo ปีที่แล้ว +2

    Thanks, I appreciate going over the basics in depth. It is worth the time taken. Well done. Your web site and download links are very good, now I can concentrate on your content, rather than having to write everything down.

  • @duncanmarks1590
    @duncanmarks1590 9 หลายเดือนก่อน

    hi, very happy to see white background programming editor examples these are much easier to read than the previous dark backgrounds. Yes I know when "coding" dark background is less eye strain but hard to read as screen shots. bye

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  9 หลายเดือนก่อน

      Hi duncanmarks1590 ,
      The early videos had the white background for the Thonny editor. After enough complaints, I switched to the dark theme. I was not a fan of the dark theme at first, but I must admit, my eyes are far less sore after many hours of programming.
      Cheers
      Chris

  • @hardeepsingh68
    @hardeepsingh68 9 หลายเดือนก่อน

    Great contribution to the Pi-pico user community. Thanks for making immense resources available on the website. 👍

  • @jimcraig5727
    @jimcraig5727 ปีที่แล้ว +1

    Also self teaching myself Micropython using a Raspberry Pi Pico I soldered up to a prototype board containing some leds, switches & soon a potentiometer. Learned a lot from your well done tutorial on Switches & looking forward to going through the remainder of your TH-cams and hopefully those to come. Your effort is much appreciated.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  ปีที่แล้ว

      Thank you very much for the feedback Jim. Much appreciated. I am in the planning stages for filming the next series of videos about the PICO and electronics. Looks like a broader mix of tutorials and projects.

    • @jimcraig5727
      @jimcraig5727 ปีที่แล้ว

      @@MakingStuffwithChrisDeHut Looking forward to them

  • @scottellis1204
    @scottellis1204 ปีที่แล้ว +2

    Absolutely great videos! Been teaching myself python/electronics by working on projects, and your videos have been succinct and incredibly informational! Looking forward to your future topics 😀

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  ปีที่แล้ว

      Hi Scott, Thank you very much for the comments and feedback - VERY MUCH APPRECIATED!!!!! New PICO related videos will be added to the existing ones at a rate of 1 per week until early September. Well, probably longer but that is what I have filmed and being edited and uploaded. After that will be more, probably some project videos mixed in with the informational ones. Thanks again so much for the kind words, that really helps with the motivation! Please let others know about the channel too as I really need to get the subscriber numbers up.

  • @StudentTrader
    @StudentTrader หลายเดือนก่อน

    Wow thank you! I learned so much!

  • @SFXMadness
    @SFXMadness ปีที่แล้ว

    Hi there. Informative and feels complete. Appreciate the extra info and perspective you brought in, perhaps with a bit of passion transpiring there. Anyways, keep em coming. If you ever switch your tools and display to dark mode on day, I won't complain. Cheers!

  • @jackjones6936
    @jackjones6936 ปีที่แล้ว

    Great video, much appreciated! I learnt a lot and got my project working. Now I'm wanting to go to the next level and do multiple actions with a single button (Pressing for power on, holding for increasing speed/brightness and then holding again for decreasing speed/brightness, and then double pressing for a timed on/off cycle). Would you be up for doing a video on that?

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  ปีที่แล้ว +1

      Hi Jack, thanks for stopping by and the kind words! Regarding your request, I am always open to suggestions and requests and will put that request in the log book.

  • @commandprompt7171
    @commandprompt7171 ปีที่แล้ว

    Hi Chris, i want to thank you very much for explaining the switches and the buttons and even the voltage on the oscilloscope, I only have 1 question.
    If i need to add 3 more buttons to the pico can i connect 1 side of the 3 switches in series directly to the 3V3 OUTPUT and the other side of the buttons to other GP inputs?
    or is there an easier way to connect multiple buttons to the pico?

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  ปีที่แล้ว +1

      That would depend on how you want them to work - Series would require all 3 switches to be on for the circuit to be on. In parallel, each switch is independent. I suspect what you want is parallel and as such. you can use the 3.3V pin to power each of the buttons. As it is hard to connect 3 wires to a single pin, you may need to run a single wire off the board, then tie that to the three wires (one for each of your switches). I hope that make sense.

  • @jyvben1520
    @jyvben1520 ปีที่แล้ว

    great example code, but sometimes the game code might be take too long to catch the button press ...
    probably not a problem on the ultra fast pico ...
    some of the printouts might have benefitted from adding a timestamp (ms) on each line, would show a scrolling action ...

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  ปีที่แล้ว

      Thanks for the feedback, much appreciated!

    • @RufftaMan
      @RufftaMan 10 หลายเดือนก่อน

      yeah, that's my problem too. I have code that takes around 0.1 seconds to run, which makes missing a button press quite possible.
      Was looking for ideas on how to work around this.
      Maybe using a trigger function and "storing" the button press until the main code catches up and acknowledges it. Not sure yet.

  • @VoeViking
    @VoeViking ปีที่แล้ว

    Sorry, but why do you write machine.Pin(25, Machine.Pin.OUT) and not only write Pin(25, Pin.OUT) Thank you.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  ปีที่แล้ว

      Hi VoeViking, It is a bad habit of sorts. Some functions within some libraries require using the library_name(dot) notation. Generally, it is not required.

    • @jackjones6936
      @jackjones6936 ปีที่แล้ว

      Correct me if I'm wrong but I think if you write machine.Pin() then you're identifying the pin via the number on the pico but if you use just Pin() then you're using GPIO numbering which is not as simple due to ground pins not having a number. I don't think it matters which you use as long as you know the naming convention so that you're identifying the correct pin you want to use.

    • @bobcharles3029
      @bobcharles3029 ปีที่แล้ว

      It depends on how you import machine ie import machine VS from machine import pin