#2,999 in Industrial & Scientific

Reddit mentions of Gufastore 6pcs KY-040 Rotary Encoder Module with Knob Cap for Arduino

Sentiment score: 1
Reddit mentions: 1

We found 1 Reddit mentions of Gufastore 6pcs KY-040 Rotary Encoder Module with Knob Cap for Arduino. Here are the top ones.

Gufastore 6pcs KY-040 Rotary Encoder Module with Knob Cap for Arduino
Buying options
View on Amazon.com
or
    Features:
  • Used Book in Good Condition
Specs:

idea-bulb Interested in what Redditors like? Check out our Shuffle feature

Shuffle: random products popular on Reddit

Found 1 comment on Gufastore 6pcs KY-040 Rotary Encoder Module with Knob Cap for Arduino:

u/dittonetic ยท 1 pointr/crankshaft

I figured all rotary encoders were the same. I'm fairly new to them, anyways I'm using these ones: https://www.amazon.com/Gufastore-Encoder-Anti-Static-Tweezers-Arduino/dp/B07BN3DGBS/ref=sr_1_1_sspa?ie=UTF8&qid=1536956359&sr=8-1-spons&keywords=rotary+encoder&psc=1

So all this program is doing is converting the rotary encoder directional input and allowing me to control media through the gpio header on the rpi. The gpio ability is already in crankshaft but hooking up a rotary encoder directly to the pi is exciting and doesn't work as you'd want it to. So this simulates pushing a button, or simply grounding the gpio pin you want to when you dial the encoder left or right.

At the top of the script is a sorta wiring guide for how it's currently scripted. I hook up the CLK and DT from the encoder to pins 7 & 8 on the pro micro, these are essentially the left and right rotational direction of the encoder. SW is connected to pin 9, this is pushing the rotary encoder button (center click like a joystick) - these are the inputs on the pro micro. Pins 4, 5 and 6 on the pro micro are the outputs and they output directly to the raspberry pi GPIO header. 5 and 6 go to the predefined vol up/down pins, and then you need to add the play/pause or whatever function you want to the gpio config on the rpi SD card.

I take the 5v out from the RPI gpio header to power the arduino, and that all connects to the + connection on the rotary encoder. Same with ground, to arduino and to the encoders. Once you program the arduino you don't need to plug it in via usb again. It gets it's power direct from the rpi.

​

I'll be using two rotary encoders (there are enough pins on the rpi to do two of these, if you wanted to have next/previous track on another encoder) so I'll have a copy of my GPIO config and installation pictures this weekend.