Rotary Encoder and Touchscreen questions

Posted on
Thu Jan 31, 2019 9:50 am
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Rotary Encoder and Touchscreen questions

Hey Karl

Thanks so much for all the awesome programming and write ups, its truly appreciated!

I've been googling and searching the forum and I can't quite wrap my head around how connect a rotary encoder with push button to pibeacon. Would I just use the GPIO Max 8 Pin? I probably over thinking it all as I haven't ordered one yet to test.

My goal is volume control for bathroom speakers which are all tied into indigo.

My second question (having never directly seen the video output from a pibeacon) is: Does the UI have a web browser / touch support? You probably know where this is going... Is there a way to display and interact with a control page?

Posted on
Fri Feb 01, 2019 9:27 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

your rotary encode decoder has 4 pins and a hex /grey output? ==> please post your dev specs, there are so many variations

connect 4 GPIOs to the device.
define 4 GPIO input device in indigo with these gpios

you will then see their states in the device

now THEN you need to translate that into a single value.

BUT this looks interesting I might add that as a device " INPU-ROTARY 4GPIO"

give me the weekend and I would need to get a device to make sure that works.


As for driving the output: there is little direct interaction on the RPI GPIO--> display as this gets complicated quickly and has an infinite number of combinations. (need an indigo on the RPI)


so let me play around with this.. just thinking out loud.

Karl

Posted on
Mon Feb 04, 2019 8:53 am
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Re: Rotary Encoder and Touchscreen questions

The encoder I am using is a CYT1100. I just need two GPIO pins and a ground for the encoder. I have the push button portion working fine. I've gone through the device list checking what I seem might be appropriate but I can't seem to find one device that'll take two GPIOs and transition them accordingly.

Posted on
Mon Feb 04, 2019 10:38 am
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Re: Rotary Encoder and Touchscreen questions

I've set up and down as regular buttons (not sure if I'm doing it correctly, they are defined as GPIO max 1 pin) to count on transitions, but they don't count. I switch back to regular input and I get a count displayed but it randomly reverts to regular input. Ive pushed updated config files and rebooted and restarted indigo in between changes but no luck actually counting changes in a form I can use. Any ideas?

Posted on
Mon Feb 04, 2019 10:53 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

Could you send a copy of parameters file from
On rpi in /home/pi/pibeacon/ directory
And remove user id etc info


Sent from my iPhone using Tapatalk

Posted on
Mon Feb 04, 2019 10:56 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

And I have a rotary switch decoder device ready.
2-8 pins bits to integer value (..-255)

Working on rotary pulse switch (same as the CYT1100)
They send grey code through 2 pins and you have to count pulses of the the pins in relation to each other.


Sent from my iPhone using Tapatalk

Posted on
Mon Feb 04, 2019 1:45 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

have the rotary grey pulse encoded switch ready.. works when turn is < ~ 1step / 0.3 secs -- when done faster it might skip s switch

will post a version later today .

ONE REMARK!!! DO NOT connect the V+ to the +5PIN
- either remove the resistores on the sensors ( 10KOhm between V+ and signal pin outs)
- or connect V+ to 3.3V from the RPI

the RPI will initiate the GPIO with pull-up resistor ON = already 10K GPIO to +3.3V.

still playing with bounce time (when a switch click it might send 1 .. 10 pulses depending on the quality. you can fix that with soft or hardware

Hardware see: http://raspberrypihobbyist.blogspot.com/2014/11/debouncing-gpio-input.html
Software: with GPIO.add_event_detect( pin GPIO.RISING, callback=gpioEvent , bouncetime=5) # in mSecs
that bounce time parameters needs some fine-tuning for different switches. Will offer various values in the plugin

Posted on
Mon Feb 04, 2019 5:00 pm
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Re: Rotary Encoder and Touchscreen questions

I think the device settings window needs a save / confirm button for the encoder device. When saving using just indigo save button nothing populates in the notes window.

Posted on
Mon Feb 04, 2019 5:01 pm
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Re: Rotary Encoder and Touchscreen questions

oh yeah.... and thank you very much!!!!!

Posted on
Mon Feb 04, 2019 5:03 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

It should. Takes a minute.


Sent from my iPhone using Tapatalk

Posted on
Mon Feb 04, 2019 5:54 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

Also got this one to work.. although 600 steps/360degree is too much .
Screen Shot 2019-02-04 at 17.47.16.png
Screen Shot 2019-02-04 at 17.47.16.png (109.48 KiB) Viewed 2944 times


suggest to use a lower resolution version like: " Qauick 100p/r Incremental Rotary Encoder Dc5-24v Wide" 660 down to 100 steps/ 360 degree

Added a simple diode (eg 1N914) into the signal line (cathode to the device, anode to the GPIO; cathode has a black ring) just for safety. as this device really needs +5V - does not work w 3.3V

Although it looks as if the signal voltage does not go over 3.3V. The device is sealed so you don't know exactly what's in there.

Karl

[edit] 2 rotate switches same time on the same RPI seem to work fine (different GPIOs naturally)[/edit]

Posted on
Mon Feb 04, 2019 7:00 pm
new2me07 offline
Posts: 84
Joined: Apr 07, 2017

Re: Rotary Encoder and Touchscreen questions

I think Im going to go with something with detents or whatever gives you the clicky feeling, seems like it might be a good candidate. Is there a way to reset the counts? I've randomly seen them jump back to zero (which is what I want) but not seeing an action or command I can issue for it.

Posted on
Mon Feb 04, 2019 8:09 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Rotary Encoder and Touchscreen questions

ok, yes thats missing..
==A dded save and reset option in v .7.101.271

at start it reads last values, writes to disk when changed.
in indigo menu you have the option to send a reset command to the rpi/ INPUTrotary... program

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests