Announcement

Collapse
No announcement yet.

Help with resistive button UberMDX configuration

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with resistive button UberMDX configuration

    I have four resistive buttons hooked up to a voltage divider. They output voltages of 1.6, 2.2, 2.9, and 3.6 V, respectively. I've verified that the fusion brain correctly reads the buttons using the debug window.

    I'm trying to get these buttons to control functions in winamp. I don't know what I'm doing wrong; everything seems as if it should work, but nothing happens.

    Here is my FusionConfiguration.xml

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <FusionControlCentreConfiguration version="3.0.0.0" author="" date_created="Tuesday, 
    
    April 22, 2008 at 6:04:05 PM" last_modified="Tuesday, April 22, 2008 at 6:04:22 PM">
    
      <require>
      <!-- Begin Function Instances -->
      <!-- End Function Instances -->
      </require>
    
      <graphics>
      <!-- Begin Global Graphic Settings -->
          <main_display designed_for_size="800,600" show_at_size="800,600" 
    
    menubar="Sizeable" RunInSystemTray="False" MinimizeToSystemTray="True"></main_display>
      <!-- End Global Graphic Settings -->
    
      <!-- Begin Background Images -->
      <!-- End Background Images -->
    
      <!-- Begin Static Images -->
      <!-- End Static Images -->
    
      <!-- Begin Display Buttons -->
      <!-- End Display Buttons -->
    
      <!-- Begin Multi Images -->
      <!-- End Display Buttons -->
      </graphics>
    
      <io>
      <!-- Begin Fusion Brain Instances -->
          <brain id="My Fusion 
    
    Brain">USB\VID_04D8&amp;PID_000C\5&amp;1036E060&amp;0&amp;2</brain>
      <!-- End Fusion Brain Instances -->
    
    
      <!-- Begin Timer Setup -->
          <timer id="input" interval="75"></timer>
          <timer id="output" interval="100"></timer>
          <timer id="gui" interval="50"></timer>
          <timer id="logic" interval="50"></timer>
      <!-- End Timer Setup -->
    
      <!-- Begin Digital Output Instances -->
      <!-- End Digital Output Instances -->
    
      <!-- Begin Analogue Input Instances -->
          <iochannel id="Steering_Wheel_Control" port="9" brain="My Fusion Brain" 
    
    type="analogue_input">
            <options history="0" auto_average="true"></options>
          </iochannel>
      <!-- End Analogue Input Instances -->
    
      </io>
    
      <logic>
      <!-- Begin Logging Setup -->
        <all_logging>
        </all_logging>
      <!-- End Logging Setup -->
    
      <!-- Begin Variable Declarations -->
        <all_variables>
        </all_variables>
      <!-- End Variable Declarations -->
    
      <!-- Begin Logic Declarations -->
        <all_statements>
    
          <if fire_on="logic">
            <boolean_operation type="and">
              <parameter1>
                <boolean_operation type="greater than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>1.4</number>
                  </parameter2>
                </boolean_operation>
              </parameter1>
              <parameter2>
                <boolean_operation type="less than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>1.8</number>
                  </parameter2>
                </boolean_operation>
              </parameter2>
            </boolean_operation>
            <then>
    		<do function="send key" functionTargetID="winamp" vote_opinion="UP" 
    
    vote_priority="medium"></do>
            </then>
          </if>
    
          <if fire_on="logic">
            <boolean_operation type="and">
              <parameter1>
                <boolean_operation type="greater than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>2.1</number>
                  </parameter2>
                </boolean_operation>
              </parameter1>
              <parameter2>
                <boolean_operation type="less than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>2.4</number>
                  </parameter2>
                </boolean_operation>
              </parameter2>
            </boolean_operation>
            <then>
    		<do function="send key" functionTargetID="winamp" vote_opinion="DOWN" 
    
    vote_priority="medium"></do>
            </then>
          </if>
          <if fire_on="logic">
            <boolean_operation type="and">
              <parameter1>
                <boolean_operation type="greater than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>2.8</number>
                  </parameter2>
                </boolean_operation>
              </parameter1>
              <parameter2>
                <boolean_operation type="less than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>3.0</number>
                  </parameter2>
                </boolean_operation>
              </parameter2>
            </boolean_operation>
            <then>
    		<do function="send key" functionTargetID="winamp" vote_opinion="X" 
    
    vote_priority="medium"></do>
            </then>
          </if>
          <if fire_on="logic">
            <boolean_operation type="and">
              <parameter1>
                <boolean_operation type="greater than or equal to">
                  <paarameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>3.5</number>
                  </parameter2>
                </boolean_operation>
              </parameter1>
              <parameter2>
                <boolean_operation type="less than or equal to">
                  <parameter1>
                    <analogue id="Steering_Wheel_Control" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>3.9</number>
                  </parameter2>
                </boolean_operation>
              </parameter2>
            </boolean_operation>
            <then>
    		<do function="send key" functionTargetID="winamp" vote_opinion="V" 
    
    vote_priority="medium"></do>
            </then>
          </if>
        </all_statements>
      <!-- End Logic Declarations -->
      </logic>
    </FusionControlCentreConfiguration>

  • #2
    The code is correct. Only thing I can think of is you are using a newer version of Winamp. The pre-coded winamp title (why you just have to put "winamp" in) is for version 2.95.

    What version of Winamp are you using?
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

    Comment


    • #3
      That might be it, I'm using Winamp 5.33. How do I get the correct targetID?

      Comment


      • #4
        Do you have access to Spy++ or a similar program? I dont think I am aloud to redistribute Spy++ since it is part of the Microsoft EULA crap. But it might be part of Visual Studio Express VB... I know it is not in Visual Studio Express C#. And there are free programs that do just that too that you can download. In the future this will be automatic in the configurator.
        Fusion Brain Version 6 Released!
        1.9in x 2.9in -- 47mm x 73mm
        30 Digital Outputs -- Directly drive a relay
        15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
        Buy now in the MP3Car.com Store

        Comment


        • #5
          Ok I got it working with winamp 2.95. The button's have a non-negligible decay time. So it is possible for a higher voltage button press to trigger lower voltage buttons on the way up or down. How can I address this problem?

          Also:

          What is the syntax for sending longer keystrokes, say like CTRL+SHIFT+S

          How can I have a button control the windows master volume?

          Comment


          • #6
            Originally posted by stimpak View Post
            The button's have a non-negligible decay time. So it is possible for a higher voltage button press to trigger lower voltage buttons on the way up or down. How can I address this problem?
            Can you post the circuit you're using?

            Comment


            • #7
              Originally posted by stimpak View Post
              Ok I got it working with winamp 2.95. The button's have a non-negligible decay time. So it is possible for a higher voltage button press to trigger lower voltage buttons on the way up or down. How can I address this problem?

              Also:

              What is the syntax for sending longer keystrokes, say like CTRL+SHIFT+S

              How can I have a button control the windows master volume?
              Currently only 1 button at a time.

              And if you are just using the steering wheel controls, you can set the sample rate low enough that it will be negligable. If you are using it for more things then it get more complicated, but still doable.
              Fusion Brain Version 6 Released!
              1.9in x 2.9in -- 47mm x 73mm
              30 Digital Outputs -- Directly drive a relay
              15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
              Buy now in the MP3Car.com Store

              Comment


              • #8
                Multiple characters would be a very nice thing to have. You could pass off the FB commands to a program like AutoIt and be able to do almost anything.

                I'm using a program called WinID to get the program titles. I'm still trying to get the hang of it though. Before I do something more complicated, I'm trying to pass characters to notepad. WinID says a new instance of notepad has a title of "Untitled - Notepad", but putting that into the configuration file doesn't seem to go anywhere.

                Comment


                • #9
                  Ironically, Notepad is really bad for this as it uses 2 different key events in timed firings.

                  I have never been able to get Notepad to work.
                  Fusion Brain Version 6 Released!
                  1.9in x 2.9in -- 47mm x 73mm
                  30 Digital Outputs -- Directly drive a relay
                  15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                  Buy now in the MP3Car.com Store

                  Comment


                  • #10
                    Originally posted by greenman100 View Post
                    Can you post the circuit you're using?

                    Comment


                    • #11


                      It's just a simple resistor/voltage divider circuit that I made to drive the steering wheel buttons. The stock button controller board used some really complicated method that wasn't resistive. There was some extra capacitance coming from the stock board. I disconnected the buttons from the stock board and they work predictably now.

                      Anyone have an idea how to control the master volume? I can pass the volume control to Winamp, which can set the wave volume, but it can't do anything about the master. Autohotkey can be set up rather easily to control the master volume, but it doesn't seem to be able to be triggered from FB's key inputs.

                      Comment


                      • #12
                        [QUOTE=2k1Toaster;1204830]Currently only 1 button at a time.
                        /QUOTE]

                        Can you run programs from fusion brain? Something like button press -->/path/something.bat

                        Comment

                        Working...
                        X