Need 4 modes with just 3 switches - need all modes to be selectable QUICKLY!


Closed Thread
Results 1 to 40 of 68

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Post

    In that case the double press is probably the best option. Something like this:

    button3 interrupt handler:

    IF timer is not running THEN
    set timer so it will overflow after x time (max double click time), and start timer running
    ELSE
    set to mode 4
    stop timer
    ENDIF

    timer interrupt handler:

    set to mode 3
    stop timer
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Bruce,

    Thanks for the idea - I'm unable to use a toggle switches (though I'd have loved to have), because this PIC/PCB/Switches are going in a small control box with just 5.5mm headroom inside (just under 1/4"" in old money)....also the control box will affixed to the guitar body with four small adhesive pads - a toggle switch would mean the player would be applying force 'sideways' on the switch (with respect to the control box surface), which could place some stress of the adhesive fixings whereas momentary switches, the force will be down (ie pressing the adhesive pads down).

    Kamikaze47,

    i'm not a programmer...& this stuff doesn't come naturally to me....but thanks for the example to get me started, I'll see how I can weave that concept into my code over the next day or two.

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HankMcSpank View Post
    Kamikaze47,

    i'm not a programmer...& this stuff doesn't come naturally to me....but thanks for the example to get me started, I'll see how I can weave that concept into my code over the next day or two.
    Give it a try, and if you get stuck, post the code you have written here and we can help.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default chords

    3 buttons right? 4 modes.....


    press button 1 to enter mode 1
    press button 2 to enter mode 2
    press button 3 to enter mode 3

    press both 1&2 to enter mode 4
    press both 2&3 to enter mode 5

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    I assume the switches are right next to eachother? if so, why not make it so that mode 4 can be activated by pressing 2 and 3 at the same time. ...
    Quote Originally Posted by HankMcSpank View Post
    A guitarist will be selecting these switches with his right hand - this will already have a plectrum in it (between the thumb and forefinger), this leave him needing to press two switches concurrently but with two fingers partially out of action - then there's the accuracy at landing fingers on two small (3.5mm diameter) button tops 'on the fly' in mid solo etc on a dimly lit stage etc.
    What if the accuracy wasn't as difficult?

    Maybe any 2 buttons pressed at/near the same time could be mode 4.
    You wouldn't have to find the correct 2 buttons. Any two (or 3) will do. So it should be easier for the player.
    DT

  6. #6
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Three pins will easily support up to six Charlieplexed switches (requires one diode per switch).

  7. #7
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Just an update (since you've all been so kind to chime in with your ideas...many thanks!)

    Last night got home & thought ok....ok, so let's learn about timers - so I went to Darrel's site & saw the timer based flashing LED example....absolutely perfect for one of my other needs -so I went off on a slight (but related) tangent!!

    I have a tri-colour LED - ie a green & red LED (which obviously also gives amber if they're both switched on at the same time).....so three possible colours. But with four operational modes, I also need a visual representation to the player when in the the fouth mode - that'd be a flashing LED!

    Previously, I was checking regularly within the main code to see if the player had selected the 4th mode - and if so, I'd flash an led. But as Darrel has mentioned to on his site, it's tricky using this method to have a flashing LED with stable, regular interval flashes.

    So Darrel's solution was a breath of fresh air (thanks Darrel - again )

    I then got waylaid trying to work out some wayof getting my program, to 'remember' whether switch3 was last selected in 'mode 3' or 'mode 4' (I have an involved switching arrangement, where any of the 3 switches will turn the device on...once on, you can freely press another switch to move to ther other modes - but for user practicality, if the unit was switched on in mode3, then say switch 2 was pressed, when going back to switch 3, I'd reckon the player would want whichever mode he was last in with switch3 to be recalled - eeeuggh ...this is getting wordy & hard to describe so I'll digress!).

    Darrel...good idea about 'any two...no matter which two' ....I'll mull that one over (might be better than me having to learn about timers for my situation!!). The wierd thing is that even though some ideas seem fine, when you come you actually use them ....they're not so good. My earlier example about holding swith3 longer to enter mode 4 - it just doesn't fit in with the intended applicated - fast switching for a guitarist going hell for leather!


    Mike....all my switches use diodes.
    Last edited by HankMcSpank; - 6th August 2010 at 10:57.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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