Reddit Reddit reviews uxcell 100 Pcs 6x6x4.5mm Panel PCB Momentary Tactile Tact Push Button Switch 4 Pin DIP

We found 3 Reddit comments about uxcell 100 Pcs 6x6x4.5mm Panel PCB Momentary Tactile Tact Push Button Switch 4 Pin DIP. Here are the top ones, ranked by their Reddit score.

Industrial & Scientific
Electronic Components
Electromechanical Products
Switches
Pushbutton Switches
uxcell 100 Pcs 6x6x4.5mm Panel PCB Momentary Tactile Tact Push Button Switch 4 Pin DIP
Product Name : Tact Switch;Quantity : 100+/-2% Pcs;Contact Type : Momentary ContactDimension : 6 x 6 x 4.5mm / 0.24" x 0.24" x 0.18" (L*W*H);Button Dia. : 3.5mmPin Pitch : 5 x 6mm / 0.2" x 0.24"(L*W);Pin Length : 5mm / 0.2"Material : Plastic, Metal, Electric Parts;Color : Black, Silver ToneNet Weight : 29g;Package Content : 100 x Tact Switches
Check price on Amazon

3 Reddit comments about uxcell 100 Pcs 6x6x4.5mm Panel PCB Momentary Tactile Tact Push Button Switch 4 Pin DIP:

u/TheOnlyJonto · 4 pointsr/RetroPie

Yes they connect to the GPIO. I would use some pushbuttons like this then get some of these dupont cables to connect them to the GPIO on your Pi. Just snip and strip the male end of the cable and solder it to the leads on the button. You'll want to daisy chain one lead from all of the buttons and plug that into a ground pin on the Pi then connect the other lead from the button to an availible GPIO pin shown on this page in the "connecting to the Raspberry Pi" section.

After you have your buttons all connected, you'll need to install Retrogame. It's very simple but Adafruit's guide is pretty bad, if you ask me. I had a hell of a time figuring it out the first time so I'll just explain it to you here to save you time.

Use Putty on your PC to SSH into the Pi (you can find your Pi's IP address in the Retropie menu in Emulationstation, the port is 22, and use the SSH connection type, then the username is Pi, password is raspberry - when you type the password into the terminal nothing will show up, just hit enter when you're done and you'll have direct control over the terminal on your Pi). Now copy this code and right click in the terminal window to paste and hit enter

git clone git://github.com/adafruit/Adafruit-Retrogame
When that's done enter this

sudo nano /etc/rc.local
Enter the following right before where it says "exit 0"

/home/pi/Adafruit-Retrogame/retrogame &
Hit ctrl+x and save the file. Now enter

sudo nano /etc/udev/rules.d/10-retrogame.rules
And enter this in the new document

SUBSYSTEM=="input", ATTRS{name}=="retrogame", ENV{ID_INPUT_KEYBOARD}="1"
Now save the file just as with the previous one.
Now download the retrogame.cfg from the retrogame github and open it with a text editor on your computer (if you don't already have it now would be a good time to get Notepad++) and change the keybinding you want to use for the corresponding pin. Save the file and copy it in the boot directory of your Pi by putting the SD card in your computer.

That should do it.

If you need any help or more information just ask. I know how irritating this stuff can be. I've been wrestling with getting my setup working perfectly for a while and have just recently figured it all out. It's great once it works!

Edit: formatting fixed.

u/BillDaCatt · 2 pointsr/led

Not the person you replied to, but I will try to help.

Electrical switches are relatively simple devices but because there are so many styles of switches available, what you are asking for is really not that simple.

The first question is: What style of switch do you want? Toggle, momentary toggle, push button, momentary push button, rotary, magnetic, rocker? There are literally hundreds of thousands of different switches available.

The next question is how will you be making the connection? Solder, crimp, barrel connector, dupont, molex, scotchlok, screw terminal?

And finally, how and where will you mount the switch? Inline on the wiring harness? Do you need to drill a mounting hole? Are you looking for something that comes with mounting hardware? Is there clearance for your switch location?

I know this is all new to you and I am throwing out a bunch of terms you may have never even heard before. The simple solution for you, at least at first, might be to wire your LED strip right into the output screw terminals of your power supply. Then when the printer is on your light is on, and the light is off when the printer is off. Just be sure to mind the polarity (red to +, black to -) and wire into the 24v dc output side and not the 120v ac input side of the terminal block.

If it helps, here is a short list of switches I have purchased for different projects (all of these require soldering and some kind of mounting hole or hardware):

https://smile.amazon.com/gp/product/B00SUXW18S
https://smile.amazon.com/gp/product/B008DS1GY0
https://smile.amazon.com/ZUPAYIPA-Solder-Rocker-Switch-Toggle/dp/B01N2U8PK0
https://smile.amazon.com/Magic-shell-5-Pack-Rocker-Position/dp/B07D285PLL
https://smile.amazon.com/gp/product/B008ICKO30

u/uhmIdontknow · 2 pointsr/raspberry_pi

There's nothing wrong with your code, I just ran it and it works fine. Are you sure that you are wired up correctly?

  • Are you on gpio21 (pin 40, lower right hand corner)?

  • is your button connected to ground?

  • If you are using one of those little 4 pronged momentary buttons, make sure that you have it connected correctly, 2 pins on each side are always connected to each other, so try moving 1 wire to a different pin.