Jump to content

MMjoy


Recommended Posts

Ok so I have these encoders you bought. But I have not messed with these ones yet. After your last post I looked closer at the ones you bought and realized they are wired a little different then the original encoders I used. These ones have resistors on the board. I am assuming these are pull up resistors. SO I am gonna have to research and get back too you. Unless someone helps first. I apologize I didn't realize they were built a little different. But at any rate I need to learn it cause I plan to use them too!

 

Thanks.

 

From what I read they are pull up resistors.

Im still a bit new to Pro Micros and building stuff. As far as wiring Pots and and button matrix's I do fine and no trouble.

But I have never messed with encoders. My luck I have the wrong encoders, I did buy them awhile back but just havent gotten around to doing anything yet(surgery). Just planning the layout and trying to plan the matrix.

 

An example I plan to use these encoders is a button box with

 

x4 Momentary 3 way toggles

x1 3 way toggle

x12 buttons

x4 Encoders

Link to comment
Share on other sites

Well Im not sure if that amazon link is working now so here is the info on them.

Also in the underlined description below, Im not sure if that button switch is only for the reset to zero it says or if can do something else altogether. Be nice if I can make the button do something else.

 

Does an encoder count as 2 different button presses for the -/+ or would it show as 1 button when using it keybinds. Like I said Im new to encoders.

 

 

KY-040 Rotary Encoder Module Brick Sensor Development for Arduino with Knob cap (5 PCS)

 

-Working voltage: 5V; Pulse number per revolution: 20

-Rotary encoder count number of output pulse output through the process of positive and

negative direction rotation

-360 degree rotation, this rotation counts are not limited.

-Cooperate with the buttons on the rotary encoder, can be reset to the initial state, that starts

counting from zero

-Knob Cap: Made of aluminium alloy, diameter: 15mm/ 0.59"; height: 16.5mm/ 0.65"

 

 

CSIisvy.jpg

 

And after posting this image I noticed they dont have mounting threads,I can still make em work.


Edited by rabidscoobie
Link to comment
Share on other sites

Well Im not sure if that amazon link is working now so here is the info on them.

Also in the underlined description below, Im not sure if that button switch is only for the reset to zero it says or if can do something else altogether. Be nice if I can make the button do something else.

 

Does an encoder count as 2 different button presses for the -/+ or would it show as 1 button when using it keybinds. Like I said Im new to encoders.

 

 

KY-040 Rotary Encoder Module Brick Sensor Development for Arduino with Knob cap (5 PCS)

 

-Working voltage: 5V; Pulse number per revolution: 20

-Rotary encoder count number of output pulse output through the process of positive and

negative direction rotation

-360 degree rotation, this rotation counts are not limited.

-Cooperate with the buttons on the rotary encoder, can be reset to the initial state, that starts

counting from zero

-Knob Cap: Made of aluminium alloy, diameter: 15mm/ 0.59"; height: 16.5mm/ 0.65"

 

 

CSIisvy.jpg

 

And after posting this image I noticed they dont have mounting threads,I can still make em work.

 

So I go it to work I need to draw pic give me a bit!

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

This is my current setup with 6 encoders in a matrix

picture.php?albumid=1169&pictureid=8788

 

 

This is how I hooked the ky-040 encoder up and got it to function in windows joy.cpl joystick panel.

picture.php?albumid=1169&pictureid=10408

 

picture.php?albumid=1169&pictureid=8396

And I didn't have to adjust MMjoy. Heres a pic of the pinout ^. Its consider a button press. 1 button to the left and 2nd button to right.

I also used different pinouts but for the assignment of the Button Rows, they are all the same here's a pic of my setup for encoder in mmjoy. I used B3 and B2 but you can use D3 and D2. I placed a orange path from switch to the next pin in matrix you have to remember not to assign it as a encoder but button. Mines not setup that way cause I have shift register for the buttons. So you have to experiment with that. Technically 1 thru 12 are programmed for encoders and everything 13 and above is only a button. I have done multiple edits just FYI. hope this helps.

picture.php?albumid=1169&pictureid=10411


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

This is my current setup with 6 encoders in a matrix

picture.php?albumid=1169&pictureid=8788

 

 

This is how I hooked the ky-040 encoder up and got it to function in windows joy.cpl joystick panel.

picture.php?albumid=1169&pictureid=10408

 

picture.php?albumid=1169&pictureid=8396

And I didn't have to adjust MMjoy. Heres a pic of the pinout ^. Its consider a button press. 1 button to the left and 2nd button to right.

I also used different pinouts but for the assignment of the Button Rows, they are all the same here's a pic of my setup for encoder in mmjoy. I used B3 and B2 but you can use D3 and D2. I placed a orange path from switch to the next pin in matrix you have to remember not to assign it as a encoder but button. Mines not setup that way cause I have shift register for the buttons. So you have to experiment with that. Technically 1 thru 12 are programmed for encoders and everything 13 and above is only a button. I have done multiple edits just FYI. hope this helps.

picture.php?albumid=1169&pictureid=10411

 

 

Ok I think I understand this...I think...:noexpression:

 

So in the first pic it works just like a normal button in a matrix. But with the ky-040 I have to also connect the ground wire and Im assuming I can connect say the ground to 4 encoders altogether to 1 ground wire.

So then I would start splicing in my buttons plus their diodes inline with the encoders but just acting like im connecting to more buttons instead of encoders.

 

I see you dont have a wire for the "SW" terminal on the encoder. I'm assuming that is for the button press you get when pressing down for the encoder?

Any idea how that works?

 

The description says it can be used a reset for the encoder, but I was curious if anything else can be done with it? That maybe getting things confusing a bit.:unsure:

 

Thank you for all the help, I have a much better understanding now I think. Im still waiting on my Pro Micro to come in so I havent been able to really test anything.

 

Also, in your 1st pic, are those 12 seperate wires going to the BC columns?

That pic sorta confuses me.

 

In this example I did, would this be right?

 

TIBIb3b.png


Edited by rabidscoobie
Link to comment
Share on other sites

 

my encoders they show 5 connections and for just using in games Im not sure all 5 connections are even used.[/url]

 

An Encoder use two buttons connections, then need 3 pins = button 1, button 2, Common.

 

Your Encoder have 5 pins because have a 3rd button when pressed, this button have independent connection, hence 2 more pins instead 1.

 

Wire Encoder 3 pins like Github scheme and push button 2 pins like a ordinary button.


Edited by Sokol1_br
Link to comment
Share on other sites

So no you can start with one BR and daisy chain that with 3 encoders then all outputs would be individual to the BC. And common ground is ok. here a 3 encoder setup. But as soon as you add another BR to for another 3 encoders and 6 more outputs to the BC pins then you add diode to the outputs!

 

picture.php?albumid=1169&pictureid=10414


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

PCB in this KY-040 Encoder more hinder than help for use in MMjoy2, because are resistors in PCB and common pin for Encoder and Switch are shared.

 

https://i0.wp.com/henrysbench.capnfatz.com/wp-content/uploads/2015/05/Keyes-KY-040-Rotary-Encoder-Module-Schematic.png

 

So if I just remove the PCB from the encoder then it would work and wire up like a normal encoder?

Then I just run wires for the press down switch into the matrix just like all the other buttons I will be adding?

But if I leave the PCB on then I lose out on the press down switch,correct?

 

After playing around with placement in my enclosure I was thinking about removing the PCB anyway. I dont mind removing them,I dont have a lot to do these days and I enjoy this stuff.

 

I got these cause they were kind of cheap and included the knob caps.

 

So far from the help I have gotten from this thread over the last year or 2 has been great.

Link to comment
Share on other sites

PCB in this KY-040 Encoder more hinder than help for use in MMjoy2, because are resistors in PCB and common pin for Encoder and Switch are shared.

 

https://i0.wp.com/henrysbench.capnfatz.com/wp-content/uploads/2015/05/Keyes-KY-040-Rotary-Encoder-Module-Schematic.png

 

So if I just remove the PCB from the encoder then it would work and wire up like a normal encoder?

Then I just run wires for the press down switch into the matrix just like all the other buttons I will be adding?

But if I leave the PCB on then I lose out on the press down switch,correct?

 

After playing around with placement in my enclosure I was thinking about removing the PCB anyway. I dont mind removing them,I dont have a lot to do these days and I enjoy this stuff.

 

I got these cause they were kind of cheap and included the knob caps.

 

So far from the help I have gotten from this thread over the last year or 2 has been great.

 

 

Sokol1 is correct, I didn't realize when I bought these my self that they shared the one pin. All though I believe you should be able to add the SW in to the matrix. maybe wire like this. Sorry for all the crude drawingspicture.php?albumid=1169&pictureid=10417

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

So if I just remove the PCB from the encoder then it would work and wire up like a normal encoder?

 

Don't need remove encoder from PCB - risk damage their internals with solder iron heat - industrial solder is hard to remove.

 

Leave then there but cut PCB trails from encoder pins for PCB pins and put straight length of wires there, one for each pint, in that way you leave switch isolated from encoder.

 

This PCB seems designed for serial connection, in MMjoy2 you need use Diode Matrix or Shift Register connection.

Link to comment
Share on other sites

Sokol1 is correct, I didn't realize when I bought these my self that they shared the one pin. All though I believe you should be able to add the SW in to the matrix. maybe wire like this. Sorry for all the crude drawingspicture.php?albumid=1169&pictureid=10417

 

I tried wiring it up the way you showed. But all I got where anywhere from 5-20+ buttons lighting up at once in MMjoy.

Not sure why. I tried putting them as encoder and as buttons and same results just made less buttons light up.

 

After playing around and getting more understanding of the encoders it just seems like the PCB on the encoder is complicating everything for me.

I have like 15+ of those same encoders. So im gonna try Sokol 's idea and cut the traces and just solder onto each lug and see how that works out.

Without a PCB and just the encoder looks a lot more simple,they are just fancy buttons.

 

I also noticed where you showed a screenshot in an earlier reply for MMJOY and saw you had a shift register in the button settings or which Im not using. I didnt know if that could have something to do with the problem.

 

Anyway open to ideas what happened.

Link to comment
Share on other sites

Before you cut the the traces can you tell me what BR and BC assignment and how you defined the button you set in mmjoy? when I posted the pic of mmjoy I circle everything that sets the encoder up as reference. But because you have a sw involved you have a different setup per the last wiring diagram. Also later today I will set a couple of encoders up with this setup.


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Before you cut the the traces can you tell me what BR and BC assignment and how you defined the button you set in mmjoy? when I posted the pic of mmjoy I circle everything that sets the encoder up as reference. But because you have a sw involved you have a different setup per the last wiring diagram. Also later today I will set a couple of encoders up with this setup.

 

Well since I was going to be using all the BC and BR I added them all.

 

Just to verify I am using the right BR and BC

BR

D3 D2 D1 B1 B2 B3

 

BC

D0 D4 C6 D7 E6 B4

 

I tried with one encoder 1st and got a bunch light up at once, turn encoder then all but 4 went of turn another notch and back to a bunch.

I wired a normal switch just to make sure wasnt an issue with Pro Micro and it worked normal.

As for cutting traces, I have some extras and doing that with one will ensure Im understanding the encoder right. Later I'll cut traces on 1 just to see.

 

EDIT:

I forgot to mention that wires went to D3 then D0 and D4. Then GND.


Edited by rabidscoobie
Link to comment
Share on other sites

Ok I see np. Your Pin out looks great

EDIT-Ok so I wired one encoder up reflashed promicro. I get it to work SW fires but when I twist the encoder both direction it fires the switch too. Is this what you were talking about? I m think it you might be right to cut the trace or snip the one leg off the in side of the sw and hard wire off PCB. So my previous setup all the encoder sw were wired in to a shift register so I didn't have to try to incorporate them in the matrix. Gonna try one more thing roll back to previous stable version of MMjoy.

 

EDIT-EDIT-Ok another try with the previous version of MMjoy and in twisting the encoder it ghosts the sw button. I believe its the resistors is the problem it should be diodes it probably would not ghost then. Interesting.


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Ok I see np. Your Pin out looks great

EDIT-Ok so I wired one encoder up reflashed promicro. I get it to work SW fires but when I twist the encoder both direction it fires the switch too. Is this what you were talking about? I m think it you might be right to cut the trace or snip the one leg off the in side of the sw and hard wire off PCB. So my previous setup all the encoder sw were wired in to a shift register so I didn't have to try to incorporate them in the matrix. Gonna try one more thing roll back to previous stable version of MMjoy.

 

EDIT-EDIT-Ok another try with the previous version of MMjoy and in twisting the encoder it ghosts the sw button. I believe its the resistors is the problem it should be diodes it probably would not ghost then. Interesting.

 

I did make edits

Ok ive been playing around.

I cut the traces and I get the SW to work fine but the 2 buttons that the encoder is suppose to trigger both light up at once.

I make one click(turn) both go off,make another turn(click) they come back on.

 

So I thought maybe something in that board was causing the issue, I removed the PCB and get the same result.

 

As a normal looking encoder I wired like this:

 

Center Pin to BR

2 outer Pins to BC

 

Switch side 1 to BR other to BC

 

You said I could also cut the one leg off inside,you kinda lost me on that.Which leg were you referring to. CLK DT SW + GND

 

As of now its lighting up buttons 14 and 20(encoder) and 33 for SW.

Im not getting anywhere now.

 

LG5gNj3.png


Edited by rabidscoobie
Link to comment
Share on other sites

After messing around with it for awhile and reading on the encoders a bit I think I may have had it working but thought it wasnt. Not sure.

 

So Im assuming that with a single click both buttons are suppose to light up but as an encoder it only reads the first one that lights.

 

But with the ones I have they light so fast they look like they light at same time. But if I turn very slowly I can kinda a see 1 light first depending on the direction Im turning it.

But if I take the 2 that light up and put them in the encoder field then nothing will light up anymore.

This is with the encoder removed from the PCB to make it simple until I understand this.

 

But I just cant consistently get just 1 encoder working. Im starting to wonder if these encoders work for what Im doing with them.

 

Also as for looking up on encoders a bit and the pro micro, there are so many different ways to wire them that just doesnt make much sense to me.

 

This encoder stuff has frustrated me tonight

Link to comment
Share on other sites

I understand I have been working trying to get the PCB one to work I think the stand alone are the ones to use. So to your question about the how they light up they should light individually. I currently have been trying to attach my stand alone encoders and having same issue. Oh for got to tell you only program the encoders in the first 12 buttons. You can change there button number but encoders only work in the first 12.

What I have programed

 

B3, B2 for BR

 

D0, D4, C6, D7, E6, B4 for BC

 

 

I could not get it to work. Until I took this apart had it working.But currently I just got this to work The problem I think was I Used B3 and B2 but was not using the pin B2 at all nothing plugged into it. 1 hour of scratching my head I finally just knocked it down to just pin B3 and the same 6 BC above and bam the encoder and push buttons work. Maybe try 2 encoders first this set up! I think having two or more BR when not in use was the problem. Maybe try this setup and see my mmjoy pic! also pay attention to the timer. I placed them at 60ms cause when I built this radio panel that was sufficient to turn the A10 radio freq numbers one digit. Oh and have you been using the VKB button tester! Its the button below it reads the encoders.

 

 

picture.php?albumid=1169&pictureid=10421


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I understand I have been working trying to get the PCB one to work I think the stand alone are the ones to use. So to your question about the how they light up they should light individually. I currently have been trying to attach my stand alone encoders and having same issue. Oh for got to tell you only program the encoders in the first 12 buttons. You can change there button number but encoders only work in the first 12.

What I have programed

 

B3, B2 for BR

 

D0, D4, C6, D7, E6, B4 for BC

 

 

I could not get it to work. Until I took this apart had it working.But currently I just got this to work The problem I think was I Used B3 and B2 but was not using the pin B2 at all nothing plugged into it. 1 hour of scratching my head I finally just knocked it down to just pin B3 and the same 6 BC above and bam the encoder and push buttons work. Maybe try 2 encoders first this set up! I think having two or more BR when not in use was the problem. Maybe try this setup and see my mmjoy pic setup! also pay attention to the timer. I placed them at 60ms cause when I built this radio panel that was sufficient to turn the A10 radio freq numbers one digit.

 

 

 

picture.php?albumid=1169&pictureid=10421

 

Ok that last post made more sense to me.

 

Making sure I have this right.

So when adding encoders I need to connect them first in the matrix then add all the other buttons and switches afterwards?

I have never messed with these things and they are a pain.

 

Im gonna try your settings in the pic and see what happens.

 

 

EDIT:

I just did it exactly like you said in last post and I get nothing on the encoder buttons,nothing lights up. Windows Joysticks shows 6 inputs but nothing lights when I turn it.

 

Wired the 2 outer pins to BC D0 and D4 and the middle to B3.

 

EDIT:

I think I may have the encoder part working. In MMJOY I dont see anything light up. In windows joystick it will light up buttons 1 and 2 just like button presses but only on every 2nd click of the encoder.

Is that the way they function on the clicks?

I also tested it in game just to see and it did do what I put the key bind to but just doesnt show any lights in MMJOY or in the tester,


Edited by rabidscoobie
Link to comment
Share on other sites

Ok that last post made more sense to me.

 

Making sure I have this right.

So when adding encoders I need to connect them first in the matrix then add all the other buttons and switches afterwards?

I have never messed with these things and they are a pain.

 

Im gonna try your settings in the pic and see what happens.

 

 

EDIT:

I just did it exactly like you said in last post and I get nothing on the encoder buttons,nothing lights up. Windows Joysticks shows 6 inputs but nothing lights when I turn it.

 

Wired the 2 outer pins to BC D0 and D4 and the middle to B3.

 

 

So I just wired the encoders first. Also try to "clear button set" every time you make a change. I never cleared button set after change but today I did maybe it helped. Also I am not for sure if encoders are supposed to be first I just decided to do it that way for simplicity reason. I also understand you on the frustrating part because I am in same boat. Electronics is a hobby for me and I just started getting in to because of this sim. So you will get there. And there also might be unknown variables that we don't know about or aware of with mmjoy or promicro.

 

my current wiring pin setup.

Encoder 1

Middle pin B3

2 outer pins D0,D4

2 Push Button pins B3 to E6

 

 

Encoder 2

Middle Pin B3

2 outer pins D0,D4

2 Push Button pins B3 to B4

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Ok that last post made more sense to me.

 

Making sure I have this right.

So when adding encoders I need to connect them first in the matrix then add all the other buttons and switches afterwards?

I have never messed with these things and they are a pain.

 

Im gonna try your settings in the pic and see what happens.

 

 

EDIT:

I just did it exactly like you said in last post and I get nothing on the encoder buttons,nothing lights up. Windows Joysticks shows 6 inputs but nothing lights when I turn it.

 

Wired the 2 outer pins to BC D0 and D4 and the middle to B3.

 

EDIT:

I think I may have the encoder part working. In MMJOY I dont see anything light up. In windows joystick it will light up buttons 1 and 2 just like button presses but only on every 2nd click of the encoder.

Is that the way they function on the clicks?

I also tested it in game just to see and it did do what I put the key bind to but just doesnt show any lights in MMJOY or in the tester,

 

Yes!!! I adjusted the clicks with the Timer. Timer 1 mine set to 60ms on+off it sets how long the press is held. So when you open VKB button tester did you select the equipment in the pull down menu above the buttons lights? Because encoders don't show up when you use them in the regular button panel of mmjoy.


Edited by Brewnix

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Yes!!! I adjusted the clicks with the Timer. Timer 1 mine set to 60ms on+off it sets how long the press is held. So when you open VKB button tester did you select the equipment in the pull down menu above the buttons lights?

 

Yes I did.

 

I was reading up on these encoders and they are called quadrature encoders,not what other kinds there are but hoping these are the right ones for what we are doing.

Link to comment
Share on other sites

Yes I did.

 

I was reading up on these encoders and they are called quadrature encoders,not what other kinds there are but hoping these are the right ones for what we are doing.

 

ok interesting, I didn't know! Well I did get it to work with the new ones but I couldn't get the twist and the push button to work together. It was either or. I switched back to use my old stand alone encoders not the new ones like yours. Mqybe that's why it started working. I did almost post a Arduino library link for ya just because I saw it on the Arduino site. It was for the KY 040 encoder and had script for it ready to go. Maybe that might be the way to go. Just a thought.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...