Rotary encoder for volume control

Post Reply
idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Rotary encoder for volume control

Unread post by idorel77 » Tue Jul 26, 2016 11:29 pm

Hello guys ,

do you know if i can add rotary encoder on c2 for volume control?

I use my c2 in my car as carpc , music , navigation ....

Everything works nice , i can say perfect but i have small problems like a small delay when i search mp3 from playlist (can be from app , DigitalCar).

Now i miss my rotary encoder for volume control from my rpi system. It is not easy to find the volume from touch when i drive on highway ....

I appreciate any help.

Thanks.

TrippleAAA
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english
Contact:

Re: Rotary encoder for volume control

Unread post by TrippleAAA » Wed Jul 27, 2016 12:34 am

Good thought. I ordered 3 different Rotary Encoders and I will implement this in my ODLib. I could also release a little Service App that is running in the Background after every boot, then you can set the Rotary Encoder -> ODroid C2 Pins in the Settings... to control the Volume with the external Rotary Knob.
Last edited by TrippleAAA on Wed Jul 27, 2016 5:16 am, edited 4 times in total.

joerg
Posts: 810
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Contact:

Re: Rotary encoder for volume control

Unread post by joerg » Wed Jul 27, 2016 4:15 am

Interesting, also for my carPC. Can you give some details of this rotary encoder?

idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Rotary encoder for volume control

Unread post by idorel77 » Wed Jul 27, 2016 5:23 am

@TrippleAAA sounds good.

Thanks.

@joerg , my encoder is like this one. http://www.ebay.it/itm/Rotary-Encoder-S ... 1833243317

You can rotate 360 ° left, right and click when press.

TrippleAAA
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english
Contact:

Re: Rotary encoder for volume control

Unread post by TrippleAAA » Fri Jul 29, 2016 2:23 am

Ok, here is the Volume service app:

[The extension apk has been deactivated and can no longer be displayed.]

Rotary Encoder A = CLK
Rotary Encoder B = DT
Button = SWT
GND = GND

Try it without to connect "+"

I've tried it with different Rotary Encoders (1 x Adafruit, 2 x Sparkfun with RG Led and RGB Led) and is working great. Your ebay Rotary Encoder I will get tomorrow... so If it does not work, I will fix it tomorrrow.

With the button (click/press) you can mute the Volume.
.
device-2016-07-28-192539.png
Last edited by TrippleAAA on Fri Jul 29, 2016 8:20 am, edited 1 time in total.

TrippleAAA
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english
Contact:

Re: Rotary encoder for volume control

Unread post by TrippleAAA » Fri Jul 29, 2016 6:52 am

Here is a Picture of a Rotary Encoder Knob with light on:
IMG_20160728_234807628.jpg
device-2016-07-28-234626.png

TrippleAAA
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english
Contact:

Re: Rotary encoder for volume control

Unread post by TrippleAAA » Fri Jul 29, 2016 8:19 am

I've seen the schematics of your KY-040 ebay Encoder ... my Volume Service App is working fine, without any changes.

idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Rotary encoder for volume control

Unread post by idorel77 » Sat Jul 30, 2016 3:18 pm

WOW thanks a lot @TrippleAAA.

Should i use some resistor or it's ok for KY-040 ? that have some resistor on it.

The c2 becomes more nicely with that .

Thanks.

Edit. Can you share the souce code for this? I want to understand how it works.

L.Edit. if i rotate left or right the volume going down. The mute also is going to 0 (mute ) but if i press again is not going up, stay to 0.

What can be wrong, the resistor, or should i try ''+'' also?

Thanks.

TrippleAAA
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english
Contact:

Re: Rotary encoder for volume control

Unread post by TrippleAAA » Sun Jul 31, 2016 1:11 am

You can remove the circuit board and use the knob only. Then you don't need "+" and it's working fine.

The source you can find in the ODLib Source (RotaryEncoder.java) with a lot other ODLib-Examples: http://forum.odroid.com/viewtopic.php?f=137&t=21858
With the ODLib you can make all what you know from Arduino, but you are now able to do it with Android. Have fun.

rotary.jpg
(33.13 KiB) Downloaded 1087 times
Last edited by TrippleAAA on Sun Jul 31, 2016 1:44 am, edited 3 times in total.

TrippleAAA
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english
Contact:

Re: Rotary encoder for volume control

Unread post by TrippleAAA » Sun Jul 31, 2016 1:27 am

Tested now with "+" (3.3V) then the KY-040 Board is working fine. Without to remove the ciruit board and without any changes.

Now I will do other things and I can't reply in the future, but I came back shortly to tell you the result, and to finish also this little project :)

idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Rotary encoder for volume control

Unread post by idorel77 » Sun Jul 31, 2016 1:49 am

Thanks a lot :) .

I know just a little bit java. I try to learn. I did not used arduino and i don't know how to to use your library to make a app. :(

That's why i ask about source code :)

Thanks.

idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Rotary encoder for volume control

Unread post by idorel77 » Sun Jul 31, 2016 2:04 am

Works perfect but can i reverse A with B , on left is vol up and right vol down . Should be or right vol up .

Edit: I changed A with B and working :)

pglitt
Posts: 14
Joined: Thu Mar 10, 2016 1:15 pm
languages_spoken: english
ODROIDs: C1 2 C2's HIFI sheild
Contact:

Re: Rotary encoder for volume control

Unread post by pglitt » Sun Jan 08, 2017 1:14 am

AAA can you share how you turn this in to a service, or the source code, I have used the example odlib to control volume but need to change to my own service, I have other apks I would like to run in background.

User avatar
rooted
Posts: 6060
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: Rotary encoder for volume control

Unread post by rooted » Mon Jan 09, 2017 6:57 am

Any tutorial on Android services should apply.

idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Rotary encoder for volume control

Unread post by idorel77 » Wed Mar 08, 2017 8:54 pm

Hi , is anybody use this apk from TripleAAA ?

I have an error: Unfortunatley, ''ODLibVOL has stopped.''

On Android 5.1 have same error but efter hint OK , the encoder working ok .

On Android 6.0.1 i have this error , hint ok and nothing happend , i have to start app again to work.

Is anybody to handle this?

I don't know how to modify/compile from ODLib.

I think is something from permission , is possible to start before Superuser grand the access .

Thanks.

idorel77
Posts: 88
Joined: Fri May 06, 2016 12:01 am
languages_spoken: english
ODROIDs: C2
Contact:

Re: Rotary encoder for volume control

Unread post by idorel77 » Wed Mar 15, 2017 10:55 pm

From Supeuser i have this mesage : ''Developer Warning: android.permision.ACCESS_SUPERUSER not declared in manifest''

juanitomaille
Posts: 31
Joined: Thu Dec 21, 2017 12:25 am
languages_spoken: english, french
ODROIDs: XU4
Contact:

Re: Rotary encoder for volume control

Unread post by juanitomaille » Sun Nov 04, 2018 9:40 pm

Hi,

Link for download dead?

Envoyé de mon CLT-L09 en utilisant Tapatalk

Post Reply

Return to “Android”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests