Control you Raspberry Pi with a BUTTON

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • This video shows you how to control your Raspberry Pi using a button. I also show you how to turn an LED an and off using a button and the Raspberry Pi GPIO pins. This builds off part 1 - Blinking LED • Blinking LED Raspberry...
    Subscribe for more Raspberry Pi tutorials :) czcams.com/users/samwestbytech...
    I may earn commission if you purchase from the links below:
    MY CAMERA: amzn.to/3reaDlK
    MY MICROPHONE: amzn.to/3fhunSN
    MY LIGHTING: amzn.to/3dHll1i
    FREE Amazon Prime: amzn.to/3ren80W
    FREE Audible Plus: amzn.to/3xYzJsR
    RASPBERRY PI 4: amzn.to/3BC4i9I
    RASPBERRY PI PICO START KIT: amzn.to/3REvjis
    RASPBERRY PI CAMERA V2: amzn.to/3QFp90c
    ELECTRONICS COMPONENT STARTER KIT: amzn.to/3qB23xg
    ASSORTED SENSOR KIT: amzn.to/3U7M7zV
    USB SPEAKER: amzn.to/3La4foK
    USB 1080P WEBCAM: amzn.to/3Lq0OL7
    GPIO tutorial series playlist - • Blinking LED Raspberry...
    0:00 Intro
    0:23 Materials
    Raspberry Pi
    Male-Female jumper x3
    Small piece of wire (optional)
    Breadboard
    Button
    LED
    ~100 ohm resistor (BrBkBr)
    1:27 Part 1 Recap
    Raspberry Pi Foundation's tutorial - projects.raspberrypi.org/en/p...
    2:02 Set up the circuit
    3:47 Set up the code
    5:35 Add the LED circuit
    6:55 Add the LED toggling code
    9:16 LED as a switch
    11:20 Thank you
  • Věda a technologie

Komentáře • 24

  • @moganthkumar5831
    @moganthkumar5831 Před 2 lety +3

    Dude I’m learning more and more with your video , thanks man . Please continue to upload more basic stuff so that I can be strong in basics and learn more

  • @scottrupprecht4161
    @scottrupprecht4161 Před 4 měsíci +1

    Second generation Westby teaching me electronics, good work!

  • @kevinangers
    @kevinangers Před 2 lety +1

    Keep making these, they are super helpful

  • @AndyConnor_
    @AndyConnor_ Před 2 měsíci +1

    Super simple and clean!! 1 thing I’m super new to coding this and struggling to find a way to use a push button to trigger camera I have hooked up I can preview it etc but desperately need a script

  • @nyafnix7060
    @nyafnix7060 Před 15 dny

    Great tutorial

  • @123123mike
    @123123mike Před 9 měsíci

    great video. One thing, would've liked to have heard precisely how the second "while" loop worked, eg the waiting (looping), toggle, the delay (sleep), etc. figured it out though, thank you

  • @jahanstuddy1664
    @jahanstuddy1664 Před rokem

    Sir kindly make a video to control a servo motor by using Open-Cv with raspberry pi 4

  • @RBIBIANO
    @RBIBIANO Před rokem

    How to use this button as controller arrow to raspbian keyboard?

  • @hoangky1240
    @hoangky1240 Před 11 dny

    Thank you Sam... I am just wondering, do we really need "sudo nano..." while we run Python without sudo? Great tutorials, best regards from Australia.

  • @XxtheonexX1011
    @XxtheonexX1011 Před 4 měsíci

    can i add as many buttons as i want? and make a keyboard?

  • @kaashyapmithra7430
    @kaashyapmithra7430 Před rokem +2

    THE SUBSCRIBE BUTTON WAS PRESSED! 😁

  • @user-rc4np6mp3d
    @user-rc4np6mp3d Před rokem

    Just wondering if you can use a button to terminate a running program on raspberry pi

    • @winwiths.g6155
      @winwiths.g6155 Před 8 měsíci

      yes you can using subprocess python library

  • @user-jz2jx5ig6t
    @user-jz2jx5ig6t Před 2 měsíci

    Great videos. FYI you can a typo in your title. “Control youR”

  • @cd819
    @cd819 Před rokem

    Does it have to be gpio 2 ?

  • @connortaco56
    @connortaco56 Před rokem

    I have a bigger button than yours? How do I set it up to work

    • @SamWestbyTech
      @SamWestbyTech  Před rokem

      You have to figure out which wires to which thing. Figure out which wires are connected when the button is pressed and which wires are disconnected when the button is released

  • @fizzwaregaming8966
    @fizzwaregaming8966 Před rokem

    What if i dont want the button to be on the breakboard?

    • @SamWestbyTech
      @SamWestbyTech  Před rokem +1

      I use the breadboard so I don’t have to solder anything. If you don’t want to use a breadboard, you can connect the wires of the components into the circuit I talk about

    • @fizzwaregaming8966
      @fizzwaregaming8966 Před rokem

      @@SamWestbyTech Thanks

    • @fizzwaregaming8966
      @fizzwaregaming8966 Před rokem

      How can i get this working with raspberry pi pico?

  • @odedgilad9761
    @odedgilad9761 Před 7 měsíci

    why to teach python on the teminal ???