Stock/er9x Rotary Encoder

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
User avatar
jhsa
Posts: 17722
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Sat Jul 30, 2016 1:01 am

Exactly, hence my suggestion above :)
The EXT pins are the old 9x trims that are now free as the 9xtreme handles the trims. There are 8 of them and I'm using a few for 4 pushbuttons, and another for making the ELE switch 3 position. I'f I'm not mistaken, there are 8 of them :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Sat Jul 30, 2016 1:09 am

Lets wait for Mike to decide wether its possible or not. As fas as i see your idea is good but technically i dont know if it will work.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
jhsa
Posts: 17722
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Sat Jul 30, 2016 1:21 am

Why not? The old trims, as far as I know are digital pins, the same as the other pins on the processor where my encoder is connected..
The old trims are even already configured as inputs in the firmware ;) :) But yeah, let's see what Mike says, he is the one that know for sure if it is possible or not :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sat Jul 30, 2016 9:21 am

The problem with using the old trim inputs is they have a 0.1 uF capacitor across them. This significantly limits the rate at which rotary encoder changes may be detected.
There are two ways currently supported for an encoder on the 9Xtreme. One is as described on the first post of this thread. The other is to us an Arduino Pro Mini connected to the I2C/COM3 connection as described here: viewtopic.php?f=126&t=7714&p=103696&hil ... er#p103696.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 17722
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Sat Jul 30, 2016 9:36 am

Forgot about the capacitors ;) Also forgot about the arduino as I can't use the I2c on board :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW


User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Sat Jul 30, 2016 12:11 pm

Maybe it would be easy enough for me to handle it. Is there any "how to" for the mod with the arduino?
thx.

@Mike
This mini pro is good right?
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sat Jul 30, 2016 1:17 pm

That Pro Mini (3.3V, 8MHz) should be fine, only a '168, but the program is very small.
I don't think I've written anything up, I'll see if I can do something.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sat Jul 30, 2016 9:41 pm

Here is a .pdf with some instructions (and pictures), of how I wired mine.
Enc_Arduino.pdf
(104.69 KiB) Downloaded 86 times
Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Sat Jul 30, 2016 11:10 pm

Many thx mike.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Sun Jul 31, 2016 4:22 pm

Hi Mike, regarding the pull up resistors, is there any specs i should be looking for?
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sun Jul 31, 2016 5:57 pm

Nothing special, just 3.3K as the value. They only have 1mA passing through, so the power is only 3.3mW.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Tue Aug 02, 2016 11:43 pm

With this rotary encoder installed, the midle key should be the "ok" or "select" button, like the menu button is with the default layout, right? Is there any chance of making this menu button configurable for other functions? If so, what about a ersky9x version for the tx's with the encoder in which a feature is added for assigning diverse functionality to that "menu" button. Im blank here, dont really know if that is possible.
thx
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Wed Aug 03, 2016 8:48 am

That might be possible. If enabled as a different function, it would be disabled from it's normal function, which is a sort of combined MENU and EXIT button (a long press acts as EXIT).

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 17722
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Stock/er9x Rotary Encoder

Post by jhsa » Wed Aug 03, 2016 9:50 am

Mike, to eliminate completely the use of the menu and exit keys (thinking of the ArUni board) you could for example implement also a double click of the centre button.. Then you would have
normal press, double press (right timing to be tested) and long press, that you could keep as exit??

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Wed Aug 03, 2016 11:11 am

That's great, you could put a line in the hardware menu for instance, in which a user could assign it for a feature from a list, for example edit present model menu. Use it for a shortcut to whatever feature availabe on the radio.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Wed Oct 26, 2016 11:27 pm

MikeB wrote:Here is a .pdf with some instructions (and pictures), of how I wired mine.

Enc_Arduino.pdf

Mike.
Hi Mike,
reading what you wrote here, im making some progress. Since my arduino's layout differ a bit from yours i would like you to have a look and see if im on the right path.
rot.jpg
Please check if the wire disposition is right. I've been looking at older boards and i think its right, but i need your avail.
ard1.jpg
Here you can see that the A4 and A5 are not at the same spot as the arduino you have in the sketch.
ard2.jpg
Are the pull up resistor ok? As you did, they go from vcc to A4 and A5.
cables_complete.jpg
My real doubt is here. There are four wires coming from the arduino and the I2C plug has five. Which goes where?
Thanks in advance for your time.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Thu Oct 27, 2016 9:33 am

Here is the expansion grid:
Xgrid.jpg
Xgrid.jpg (83.69 KiB) Viewed 2310 times
The top row of connections is copied onto the 5-way connector labelled I2C above it, so you may use either the connector, or the connections on the expansion grid.
For the encoder you need 3.3V (pad 5), GND (pad3), and SDA (pad 2) and SCL (pad 4).

Your pull up resistors look OK.

If the connections to the encoder board are not correct, no damage to the encoder or the Arduino will occur.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Fri Oct 28, 2016 11:16 pm

@Mike
I must be cursed, i followed the instructions meticulously and the encoder only works as the normal up/down/left/right.
I have no words.
Any thoughts out there?

EDIT: It was my mistake. Sorry. Damn.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Thu Nov 10, 2016 11:28 pm

Hi Mike, in the pdf you wrote, the I04 connection of the arduino goes to the encoder center switch right?
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Thu Nov 10, 2016 11:46 pm

Correct. IO2 and IO3 are the encoder connections, IO4 is the switch.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Fri Nov 11, 2016 9:31 am

Is there a specific order for the I02 and I03? This is not clear in the pdf you wrote.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Nov 11, 2016 9:47 am

There is, but you don't know what it is until you connect and test! If you have them 'wrong' then the rotary operates in the 'wrong' direction, that is rotating clockwise moves left or reduces a value.

There is no electrical problem if they are 'wrong'.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Fri Nov 11, 2016 10:30 am

Ok, the problem is that i thought i had the connections wrong, but i checked and they are ok. Only the cross buttons work. No center switch and no rotary. i will post pictures soon.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Nov 11, 2016 11:13 am

Have you set the "I2C Function" in the Hardware menu to "I2C"?

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Fri Nov 11, 2016 11:40 am

yes.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Nov 11, 2016 11:56 am

Double checking that A5 on the Arduino goes to SCL (pad 4) and A4 goes to SDA (pad 2).

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Fri Nov 11, 2016 3:41 pm

Yes, thats right, that connection is ok.
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Fri Nov 11, 2016 4:01 pm

I plugged the Arduino with an encoder into my 9Xtreme, set the I2C option and it is working.
I assume you have flashed the Arduino from the Arduino IDE, with the correct processor selected ('168).
When the program starts running on the Arduino, it enables pull ups on the three connections to the encoder. Please check to see the encoder switch input is at VCC normally, and switches to 0V when you press the encoder switch.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
OctavioS
Posts: 576
Joined: Sun Aug 17, 2014 11:54 pm
Country: Portugal
Location: Madeira

Re: Stock/er9x Rotary Encoder

Post by OctavioS » Sat Nov 12, 2016 12:32 am

Yes, i have flashed to the right arduino with arduino ide.
regarding the last part i really dont get it, its a little bit too technical for me. Where do i see that? is it in the radio menu where you check if the buttons are ok?
3 x - 9X TX with 9xtreme board;
Turnigy 9XRpro ;
Frsky Taranis & Taranis +;
Horus x10s;
Horus x12s.
Too much radios? Yes too much damn radios. No more please.

"Sometimes you just have to take a leap and build your wings on the way down."

User avatar
MikeB
9x Developer
Posts: 15562
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Stock/er9x Rotary Encoder

Post by MikeB » Sat Nov 12, 2016 9:29 am

Using a test meter measure the voltage on the connection on the Arduino.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “er9x”