I had success getting an encoder to work. Thanks to others in this
thread for ideas! Hopefully, this will help anyone trying to get this
working. This is on piCorePlayer 6.1.
My main goal was jivelite navigation (not volume). I used one of these
generic encoders:
https://www.amazon.com/gp/product/B06XQTHDRR/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1

I wired it to the following GPIO pins, similar to what was noted in a
previous thread:


Code:
--------------------
    SW to GPIO26 (physical pin 37)
  DT to GPIO20 (physical pin 38)
  CLK to GPIO21 (physical pin 40)
  + to 3V3 (physical pin 1)
  GND to Ground (physical pin 6)
--------------------


I then downloaded pcp-sbpd.tcz and pigpio.tcz from the repo. I used this
script (thank you @chill) and placed it in the tc user home directory:

Code:
--------------------
    
  #!/bin/sh
  
  # start pigpiod daemon
  
  pigpiod
  
  # give the daemon a moment to start up before issuing the sbpd command
  
  sleep 1
  
  # load uinput module, then set the permission to group writable, so you don't 
need to run sbpd with root permissions
  
  sudo modprobe uinput
  
  sudo chmod g+w /dev/uinput
  
  # issue the sbpd command
  
  # This command will cause encoder to move selection right or left; 
Press=Enter; long press=down
  
  sbpd e,20,21,KEY:KEY_LEFT-KEY_RIGHT,4  b,26,KEY:KEY_ENTER,4,0,KEY:KEY_DOWN,500
--------------------


and this for the User Commands in Tweaks:

Code:
--------------------
    /home/tc/sbpd-script.sh
--------------------


Note that I am using KEY_LEFT and KEY_RIGHT for the rotation, and
KEY_ENTER for the button press. I also bumped the detent count to 4
because it seemed too sensitive. This allows me to scroll through, e.g.
album covers, then select one by pressing the encoder button. I am using
a long press to simulate KEY_DOWN, allowing me to scroll down a list (as
in tracks as they are displayed in jivelite). This is a little awkward
but does the job with a single encoder and no extra buttons.


------------------------------------------------------------------------
wtnh's Profile: http://forums.slimdevices.com/member.php?userid=36993
View this thread: http://forums.slimdevices.com/showthread.php?t=107001

_______________________________________________
diy mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/diy

Reply via email to