Home of the Squeezebox™ & Transporter® network music players.
Page 23 of 28 FirstFirst ... 132122232425 ... LastLast
Results 221 to 230 of 275
  1. #221
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,358
    My apologies - I did not spot that you'd changed the encoder command options. I was about to suggest that a warning isn't necessary, provided the --help output details the change, and then I discovered it does! Maybe a warning would help after all :-)

    Anyway, with the VOLU command it controls the volume very nicely. A small/slow click can be made to trigger a +1 or -1, but most twists of the encoder trigger a larger increment. It seems to be counting properly to me.

  2. #222
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,361
    Good news then, I'm not sure I've ever used my encoder.....this is one that has click stops in it, sometimes a click would be +4 and other times +1 or +7. There must be multiple steps in between clicks.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  3. #223
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,358

    [ANNOUNCE] SqueezeButtonPi - Tool to use buttons and rotary encoders on a RPi

    Well I'm not sure whether a single detent should correspond to a single pulse - I believe it probably should. I'm not seeing that happen reliably. If I click slowly and accurately I see increments of either 1 or 2, with approximately equal probability.
    Code:
    1566323311.0453 6 control.c,337: Encoder on GPIO 21, 20 value change: -2
    1566323311.0453 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323311.8494 6 control.c,337: Encoder on GPIO 21, 20 value change: -2
    1566323311.8495 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323312.5538 6 control.c,337: Encoder on GPIO 21, 20 value change: -2
    1566323312.5538 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323313.1579 6 control.c,337: Encoder on GPIO 21, 20 value change: -2
    1566323313.1579 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323314.0631 6 control.c,337: Encoder on GPIO 21, 20 value change: -2
    1566323314.0631 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323314.1668 6 control.c,337: Encoder on GPIO 21, 20 value change: -1
    1566323314.1669 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1566323314.6710 6 control.c,337: Encoder on GPIO 21, 20 value change: -1
    1566323314.6710 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1566323316.6758 6 control.c,337: Encoder on GPIO 21, 20 value change: -2
    1566323316.6759 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323317.9114 6 control.c,337: Encoder on GPIO 21, 20 value change: -1
    1566323317.9114 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    Testing with the original sbpd on my 4B 4GB shows the same sort of behaviour though (but could that be due to the extra 'chatter'? - I could test on the 4B 1GB).
    Code:
    1566323188.2414 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","0"]
    1566323188.2448 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323188.3480 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    1566323189.8526 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1566323189.9560 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-1"]
    1566323190.0593 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-2"]
    When I change the VOLU command to TRAC, I see the rather nice behaviour that you've coded to allow only one increment every 500ms to be transmitted to LMS.
    Code:
    1566323240.0735 6 control.c,329: Encoder on GPIO 21, 20 value change: 1, before 500 ms ellapsed not sending lms command.
    Perhaps something similar could be applied to the VOLU command (but with a much shorter interval than 500ms), so that precise one-increment-per-click can be guaranteed.
    Last edited by chill; 2019-08-20 at 16:59.

  4. #224
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,361
    The encoder controls are a little more convoluted, I;ll have to take a look.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  5. #225
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,358
    Hi Paul - I only made this suggestion because I assumed it would be easy to apply the same mechanism that you're using to limit TRAC requests to one-per-500ms. If there's more to it than that then I'm not even convinced that one-increment-per-click is needed, so maybe it's not worth the effort. The volume control already works nicely, and I doubt people will notice a difference between one increment and two in general use.

    However, if you do investigate this, a few thoughts:

    1) One increment per click might be a bit slow. My own encoder has 30 clicks per full revolution. So to go from 0 to 100 would take over three complete turns of the encoder. Perhaps this could be a user-configurable value. For example, for my volume buttons I use an increment of 5 (["mixer","volume","+5"]) because I found that made them more responsive than the built-in ["button","volup"] command.

    2) I captured some -z output, to see what's going on. I can see various types of behaviour.
    Sometimes there's only one interrupt:
    Code:
    1566370933.5778 7 control.c,242: Interrupt: encoder value: 23 change: 1
    1566370933.6074 6 control.c,337: Encoder on GPIO 21, 20 value change: 1
    1566370933.6075 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    Sometimes there are two interrupts with exactly the same timestamp, with the second one showing no change to the encoder value. The result is an increment of one:
    Code:
    1566370933.6358 7 control.c,242: Interrupt: encoder value: 24 change: 1
    1566370933.6358 7 control.c,242: Interrupt: encoder value: 24 change: 0
    1566370933.7111 6 control.c,337: Encoder on GPIO 21, 20 value change: 1
    1566370933.7112 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    
    1566370936.0457 7 control.c,242: Interrupt: encoder value: 28 change: 1
    1566370936.0457 7 control.c,242: Interrupt: encoder value: 28 change: 0
    1566370936.1254 6 control.c,337: Encoder on GPIO 21, 20 value change: 1
    1566370936.1254 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+1"]
    Sometimes there are two interrupts in short succession, resulting in a total change of two:
    Code:
    1566370932.8865 7 control.c,242: Interrupt: encoder value: 21 change: 1
    1566370932.8917 7 control.c,242: Interrupt: encoder value: 22 change: 1
    1566370932.9034 6 control.c,337: Encoder on GPIO 21, 20 value change: 2
    1566370932.9034 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+2"]
    
    1566370934.4686 7 control.c,242: Interrupt: encoder value: 25 change: 1
    1566370934.4787 7 control.c,242: Interrupt: encoder value: 26 change: 1
    1566370934.5153 6 control.c,337: Encoder on GPIO 21, 20 value change: 2
    1566370934.5153 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+2"]
    
    1566370936.5703 7 control.c,242: Interrupt: encoder value: 29 change: 1
    1566370936.5827 7 control.c,242: Interrupt: encoder value: 30 change: 1
    1566370936.6293 6 control.c,337: Encoder on GPIO 21, 20 value change: 2
    1566370936.6294 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","+2"]
    In those last three examples, the time intervals between the double interrupts are 11.7ms, 10.1ms and 12.4ms respectively. So at first sight, if you were to limit the VOLU interrupt rate to one every 20ms (instead of the 500ms used with TRAC), then those double interrupts would be prevented from causing two increments - they could be treated as one event, which could be programmed to send whatever volume increment the user had chosen. 20ms would correspond to 50 possible events per second, which feels like it should still be fast enough - I couldn't physically turn my 30-increment encoder through 1.67 revolutions in 1 second. But maybe the 20ms could be a user-configurable parameter too.

    Can I just check a previous detail? I'm pretty sure you're aware of this, but just in case we've got crossed wires and you thought I was referring to the original sbpd. The pigpio version currently sends the command associated with the first button in the list whenever I press any programmed button. You explained the difference in the way the pin is identified, but your explanation implied it would be simpler to know which button has been pressed under pigpio, so it seems odd that the wrong commands are being sent. Apologies if you're aware of this - I know that version was only a proof of concept etc.

  6. #226
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,361
    Quote Originally Posted by chill View Post
    In those last three examples, the time intervals between the double interrupts are 11.7ms, 10.1ms and 12.4ms respectively. So at first sight, if you were to limit the VOLU interrupt rate to one every 20ms (instead of the 500ms used with TRAC), then those double interrupts would be prevented from causing two increments - they could be treated as one event, which could be programmed to send whatever volume increment the user had chosen. 20ms would correspond to 50 possible events per second, which feels like it should still be fast enough - I couldn't physically turn my 30-increment encoder through 1.67 revolutions in 1 second. But maybe the 20ms could be a user-configurable parameter too.
    this is where it's messy. The encoder interrupt runs in the background adding + or - increments, Every 100 ms, the encoder count is retrieved, and a volume command is sent if there was a change. So I would need to add dampening to the interrupt, which I did for buttons, but I need to check the behavior with encoders.

    Can I just check a previous detail? I'm pretty sure you're aware of this, but just in case we've got crossed wires and you thought I was referring to the original sbpd. The pigpio version currently sends the command associated with the first button in the list whenever I press any programmed button. You explained the difference in the way the pin is identified, but your explanation implied it would be simpler to know which button has been pressed under pigpio, so it seems odd that the wrong commands are being sent. Apologies if you're aware of this - I know that version was only a proof of concept etc.
    I've only been talking about the pigpio version. I've not tested with 2 buttons, can you show be a trace with 2 buttons, and long an short presses of each button.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #227
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,358
    Quote Originally Posted by paul- View Post
    I've not tested with 2 buttons, can you show be a trace with 2 buttons, and long an short presses of each button.
    Here's an example where I defined two buttons:
    - GPIO 22 short press = MIX- (defined as ["mixer","volume","-5"])
    - GPIO 22 long press = MUTE (defined as ["mixer","volume","0"])
    - GPIO 25 short press = MIX+ (defined as ["mixer","volume","+5"])
    - GPIO 25 long press = VMAX (defined as ["mixer","volume","100"])

    A press of either button seems to be recognised as GPIO 22, so only MIX- and MUTE are ever sent. Short and long presses are properly detected however. In previous testing with this version it's always been the first button defined in the command string that gets recognised by any button press.

    I'll capture some -z output as well, in case that sheds any more light on this.

    Code:
    sudo /home/tc/sbpd-pigpio -v -M dc:a6:32:03:82:22 -f /home/tc/sbpd_commands.cfg b,22,MIX-,2,0,MUTE,500 b,25,MIX+,2,0,VMAX,500
    1566404257.5381 6 sbpd.c,284: Options parsing: Set verbose mode
    1566404257.5382 6 sbpd.c,309: Options parsing: Manually set MAC: dc:a6:32:03:82:22
    1566404257.5382 6 sbpd.c,343: Options parsing: Setting command config file to /home/tc/sbpd_commands.cfg
    1566404257.5383 6 sbpd.c,505: name=MIX+, value=["mixer","volume","+5"]
    1566404257.5384 6 control.c,81: Adding Command MIX+: Fragment ["mixer","volume","+5"]
    1566404257.5385 6 sbpd.c,505: name=MIX-, value=["mixer","volume","-5"]
    1566404257.5385 6 control.c,81: Adding Command MIX-: Fragment ["mixer","volume","-5"]
    1566404257.5385 6 sbpd.c,505: name=VMAX, value=["mixer","volume","100"]
    1566404257.5386 6 control.c,81: Adding Command VMAX: Fragment ["mixer","volume","100"]
    1566404257.5387 6 sbpd.c,505: name=MUTE, value=["mixer","volume","0"]
    1566404257.5387 6 control.c,81: Adding Command MUTE: Fragment ["mixer","volume","0"]
    1566404257.5388 6 GPIO.c,261: Initializing GPIO
    1566404257.7160 6 control.c,204: Button defined: Pin 22, BCM Resistor: up, Short Type: LMS, Short Fragment: ["mixer","volume","-5"] , Long Type: LMS, Long Fragment: ["mixer","volume","0"], Long Press Time: 500
    1566404257.7161 6 control.c,204: Button defined: Pin 25, BCM Resistor: up, Short Type: LMS, Short Fragment: ["mixer","volume","+5"] , Long Type: LMS, Long Fragment: ["mixer","volume","100"], Long Press Time: 500
    1566404257.7161 6 servercomm.c,176: Initializing CURL
    1566404257.7237 6 sbpd.c,237: Starting main loop polling
    1566404257.7240 6 discovery.c,234: Found server 0401A8C0. A new address
    1566404257.8243 6 discovery.c,345: discovery packet: port: 9000, name: pCPLoungePi4, uuid: f8c593d1-583d-4750-b7c5-7a6944c8bf18
    1566404257.8243 6 discovery.c,130: Squeezebox control port found: 9000
    1566404257.8244 6 discovery.c,149: Server address found: 192.168.1.4
    1566404300.0743 6 GPIO.c,107: Short PRESS: 191
    1566404300.0743 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404300.0876 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404300.0877 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404302.6376 6 GPIO.c,107: Short PRESS: 176
    1566404302.6377 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404302.6944 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404302.6945 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404304.6224 6 GPIO.c,107: Short PRESS: 155
    1566404304.6225 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404304.6995 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404304.6996 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404306.0980 6 GPIO.c,107: Short PRESS: 178
    1566404306.0981 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404306.1126 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404306.1127 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404309.3530 6 GPIO.c,102: Long PRESS: 1367
    1566404309.3530 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404309.4188 6 control.c,218: Button pressed: Pin: 22, Press Type:Long
    1566404309.4189 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","0"]
    1566404314.8328 6 GPIO.c,102: Long PRESS: 1628
    1566404314.8328 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404314.9268 6 control.c,218: Button pressed: Pin: 22, Press Type:Long
    1566404314.9268 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","0"]
    1566404319.7263 6 GPIO.c,102: Long PRESS: 1142
    1566404319.7263 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404319.7336 6 control.c,218: Button pressed: Pin: 22, Press Type:Long
    1566404319.7336 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","0"]
    1566404321.7697 6 GPIO.c,102: Long PRESS: 1048
    1566404321.7698 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404321.8385 6 control.c,218: Button pressed: Pin: 22, Press Type:Long
    1566404321.8386 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","0"]
    1566404325.2238 6 GPIO.c,107: Short PRESS: 100
    1566404325.2238 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404325.2445 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404325.2445 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404326.2440 6 GPIO.c,107: Short PRESS: 105
    1566404326.2441 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404326.2485 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404326.2485 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]

  8. #228
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,358
    Some -z output. I've removed all the discovery.c outputs. The four button presses in the output below were 25, then 22, then 25, then 22.

    Code:
    Last login: Wed Aug 21 17:14:18 on ttys000
    (base) Chris-Hills-MacBook-6:~ iszch$ ssh tc@192.168.1.4
    tc@192.168.1.4's password: 
             _ _____             ___  __
       ___  (_) ___/__  _______ / _ \/ /__ ___ _____ ____
      / _ \/ / /__/ _ \/ __/ -_) ___/ / _ `/ // / -_) __/
     / .__/_/\___/\___/_/  \__/_/  /_/\_,_/\_, /\__/_/
    /_/                                   /___/
    
    piCorePlayer = piCore + Squeezelite + Raspberry Pi
    
    The software is provided "as is" without warranty of any kind,
    either express or implied, including without limitation any implied
    warranties of condition, uninterrupted use, merchantability,
    fitness for a particular purpose, or non-infringement.
    tc@pCPLoungePi4:~$ ./sbpd-script.sh
    sudo /home/tc/sbpd-pigpio -z -M dc:a6:32:03:82:22 -f /home/tc/sbpd_commands.cfg b,22,MIX-,2,0,MUTE,500 b,25,MIX+,2,0,VMAX,500
    1566404967.8954 6 sbpd.c,289: Options parsing: Set debug mode
    1566404967.8955 6 sbpd.c,309: Options parsing: Manually set MAC: dc:a6:32:03:82:22
    1566404967.8955 6 sbpd.c,343: Options parsing: Setting command config file to /home/tc/sbpd_commands.cfg
    1566404967.8956 6 sbpd.c,505: name=MIX+, value=["mixer","volume","+5"]
    1566404967.8956 6 control.c,81: Adding Command MIX+: Fragment ["mixer","volume","+5"]
    1566404967.8956 6 sbpd.c,505: name=MIX-, value=["mixer","volume","-5"]
    1566404967.8956 6 control.c,81: Adding Command MIX-: Fragment ["mixer","volume","-5"]
    1566404967.8956 6 sbpd.c,505: name=VMAX, value=["mixer","volume","100"]
    1566404967.8957 6 control.c,81: Adding Command VMAX: Fragment ["mixer","volume","100"]
    1566404967.8957 6 sbpd.c,505: name=MUTE, value=["mixer","volume","0"]
    1566404967.8957 6 control.c,81: Adding Command MUTE: Fragment ["mixer","volume","0"]
    1566404967.8957 6 GPIO.c,261: Initializing GPIO
    1566404968.0564 6 control.c,204: Button defined: Pin 22, BCM Resistor: up, Short Type: LMS, Short Fragment: ["mixer","volume","-5"] , Long Type: LMS, Long Fragment: ["mixer","volume","0"], Long Press Time: 500
    1566404968.0565 6 control.c,204: Button defined: Pin 25, BCM Resistor: up, Short Type: LMS, Short Fragment: ["mixer","volume","+5"] , Long Type: LMS, Long Fragment: ["mixer","volume","100"], Long Press Time: 500
    1566404968.0566 6 servercomm.c,176: Initializing CURL
    1566404968.0660 6 sbpd.c,237: Starting main loop polling
    
    1566404971.6158 7 GPIO.c,91: 289443 - 0= 289443  Pin Value=0   Stored Value=0
    1566404971.7698 7 GPIO.c,91: 289598 - 289443= 155  Pin Value=1   Stored Value=0
    1566404971.7698 6 GPIO.c,107: Short PRESS: 155
    1566404971.7699 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404971.7721 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404971.7721 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404971.7721 7 servercomm.c,122: Server ::192.168.1.4:9000 command: {"id":1,"method":"slim.request","params":["dc:a6:32:03:82:22",["mixer","volume","-5"]]}
    
    1566404973.9662 7 GPIO.c,91: 291794 - 0= 291794  Pin Value=0   Stored Value=1
    1566404974.1390 7 GPIO.c,91: 291966 - 291794= 172  Pin Value=1   Stored Value=1
    1566404974.1391 6 GPIO.c,107: Short PRESS: 172
    1566404974.1392 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404974.1785 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404974.1785 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404974.1785 7 servercomm.c,122: Server ::192.168.1.4:9000 command: {"id":1,"method":"slim.request","params":["dc:a6:32:03:82:22",["mixer","volume","-5"]]}
    
    1566404975.2376 7 GPIO.c,91: 293065 - 0= 293065  Pin Value=0   Stored Value=1
    1566404975.3915 7 GPIO.c,91: 293219 - 293065= 154  Pin Value=1   Stored Value=1
    1566404975.3915 6 GPIO.c,107: Short PRESS: 154
    1566404975.3916 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404975.4861 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404975.4862 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404975.4862 7 servercomm.c,122: Server ::192.168.1.4:9000 command: {"id":1,"method":"slim.request","params":["dc:a6:32:03:82:22",["mixer","volume","-5"]]}
    
    1566404976.6980 7 GPIO.c,91: 294526 - 0= 294526  Pin Value=0   Stored Value=1
    1566404976.9135 7 GPIO.c,91: 294741 - 294526= 215  Pin Value=1   Stored Value=1
    1566404976.9136 6 GPIO.c,107: Short PRESS: 215
    1566404976.9136 6 control.c,107: Button CB set for button #:0, gpio pin 22
    1566404976.9912 6 control.c,218: Button pressed: Pin: 22, Press Type:Short
    1566404976.9912 6 servercomm.c,74: Send Command:0, Fragment:["mixer","volume","-5"]
    1566404976.9913 7 servercomm.c,122: Server ::192.168.1.4:9000 command: {"id":1,"method":"slim.request","params":["dc:a6:32:03:82:22",["mixer","volume","-5"]]}

  9. #229
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    2,361
    I realized that I was just calling the same function irregardless of pin, this should fix that.

    https://dl.dropboxusercontent.com/s/...gp/sbpd-pigpio

    I also tweaked the encoder to hopefully soften up the indexing.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #230
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Location
    Nottingham, UK
    Posts
    1,358
    Quote Originally Posted by paul- View Post
    I realized that I was just calling the same function irregardless of pin, this should fix that.

    https://dl.dropboxusercontent.com/s/...gp/sbpd-pigpio

    I also tweaked the encoder to hopefully soften up the indexing.
    Excellent, thank you. The buttons work perfectly now. They all do something different, and they seem to be 100% reliable. It's good to have them working properly again with my 4B 4GB.

    The encoder doesn't seem noticeably different - it still produces as many +2 increments as +1s. But that's not really a concern I think - audibly the volume responds very smoothly, and only by looking at the verbose output can you tell that the smallest increment is often a 2. Faster turns trigger bigger increments and the volume changes faster, so all very intuitive.

    Thanks for your work with this Paul - much appreciated. Assuming sbpd moves permanently to pigpio, is there an equivalent of the 'gpio' utility that comes with wiringpi? Just curious because I made a script to control a fan which relies on being able to read and set pin states from the command line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •