Announcement

Collapse
No announcement yet.

Skin Programming

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

  • Skin Programming

    I was working on a climate control skin a while back when we were working with just the Alpha version (non-MDX) and just starting with the multi-image stuff and all. I kinda faded away for a while due to work and life but I have some time now to get into this again. I have a different car now so as of now I don't need to get to complex with climate controls, but as i've been playing with MDX it seems that the programming from Alpha-non-MDX doesn't work. I can't seem to really figure out the Configurator program plus i like to just write the config file myself.

    Basically I was wondering if you could just quick write out a quick instance in the skin code for me?

    One that I need is: IF Variable_Analogue_Input_0 < 3 THEN switch Digital Output 1 ON

    Also... IF Variable_Analogue_Input_0 < 3 THEN roadrunnercommand_stop

    I hate to be bother and ask newbie questions and ask for code lines but i think with these 2 I should be pretty set. Thanks for the help!

  • #2
    http://www.mp3car.com/vbulletin/fb-d...-controls.html

    http://www.fusioncontrolcentre.com/t...ial%20Demo.htm

    Comment


    • #3
      For the RR Command part: http://www.mp3car.com/vbulletin/fb-s...ig-update.html

      And you are more than welcome to write the code yourself instead of using the configurator.

      To get the syntax down, maybe using the configurator and seeing the code it generates would be useful for you.
      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


      • #4
        That recorded walk through of the Configurator helped me out a a lot. Thanks!

        Basically what I'm doing here is making it so that if I turn the key off in the car but the PSU shutdown timer hasn't turned the PC off yet that the FB will sense the loss of voltage and pause the music in RR.

        I got it all working using IF input < 3volts then roadrunnercommand_pause but my only concern is that it keeps looping and constantly sending the pause command to RR. Is there a way to make this only occur once?

        Comment


        • #5
          Originally posted by bratnetwork View Post
          That recorded walk through of the Configurator helped me out a a lot. Thanks!

          Basically what I'm doing here is making it so that if I turn the key off in the car but the PSU shutdown timer hasn't turned the PC off yet that the FB will sense the loss of voltage and pause the music in RR.

          I got it all working using IF input < 3volts then roadrunnercommand_pause but my only concern is that it keeps looping and constantly sending the pause command to RR. Is there a way to make this only occur once?
          if input < 3, variable++
          if varaible = 1, pause
          if input >= 3 variable = 0
          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


          • #6
            i thought of that, but once the variable is set as 1 it will still loop the pause command bc it wont be set back to 0 till I turn the key back on in the car

            i tried to do:
            IF
            variable = 0
            AND
            input < 3
            THEN
            DO pause
            DO variable = 1

            it works if i leave out the "DO variable = 1" line and if i manually change the variable in the config file to 1 then obviously it wont run the statement bc it doesnt meet the criteria which is correct, but as soon as i add in the second "DO" line to change the variable it won't pause on voltage loss

            Comment


            • #7
              Code:
              <if fire_on="logic" minimum_delta_vote_time="250" id="RR_PAUSE_LOGIC">
                      <boolean_operation type="and">
                        <parameter1>
                          <boolean_operation type="equal to">
                            <parameter1>
                              <variable do="get" name="Variable_RR_PAUSE"></variable>
                            </parameter1>
                            <parameter2>
                              <number>0</number>
                            </parameter2>
                          </boolean_operation>
                        </parameter1>
                        <parameter2>
                          <boolean_operation type="less than">
                            <parameter1>
                              <analogue id="Analogue Input 0" time="0"></analogue>
                            </parameter1>
                            <parameter2>
                              <number>3</number>
                            </parameter2>
                          </boolean_operation>
                        </parameter2>
                      </boolean_operation>
                      <then>
                        <do function="external command" functionTargetID="roadrunnercommand_pause" vote_opinion="filler" vote_priority="Medium"></do>
                  	<do function="Change Variable" functionTargetID="Variable_RR_PAUSE" vote_opinion="1" vote_priority="Medium"></do>
              		</then>
                    </if>

              Comment


              • #8
                Any ideas? Am I doing something wrong?

                Comment


                • #9
                  Originally posted by bratnetwork View Post
                  i thought of that, but once the variable is set as 1 it will still loop the pause command bc it wont be set back to 0 till I turn the key back on in the car
                  It wont loop, because it only fires when it is equal to 1. Every iteration it will increment.

                  So normal operation, it is greater than 3, so variable = 0;

                  As soon as input < 3, variable increments.

                  If variable == 1, then pause music.


                  Because next iteration, input < 3, so increment variable again, now variable is 2. variable no longer equals 1, no other vote is registered. Next time variable is 3, which is not 1 nothing is registered.

                  Now when input > 3 again, variable = 0. variable != 1, so no pause vote fired.
                  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
                    Does my code above look right? when I add in the line about changing the variable mdx won't even open. if i take that line out it works but obviously since its not changing the variable it just loops the pause effect.

                    Comment


                    • #11
                      ok a few things good and bad...

                      Correction from the post above... the program would open but when the voltage dropped nothing happened.

                      Good news is that I figured it out. My first issue was that since I was only testing it I didn't put in the second code to set the variable back to 0 after it paused the music. So I found what was happening even though there was voltage going to the input there must be a slit second that the software sees it at zero so it would run that command and set the variable to 1 so then when i went to trigger it, it did nothing. Once I put that second code in to set it back to 0 it would work properly when the voltage dropped. Then a problem I ran into was when the Fusion would first start up and the software still saw that split second of no voltage it would pause the music every time even if Roadrunner was resuming play. To fix that I set the variable to start as 1 so that it wouldnt runt he pause command.

                      So it looks like this now
                      IF var=0 and input < 3 Then Pause and change var to 1
                      IF var=1 and input > 3 change var to 0

                      so when the software start var=1 but for a split sec input=0 so it doesnt do anything then once the voltage responds in the software to over 3 it kicks the var back to 0 allowing the pause command to execute upon the next voltage loss.

                      Now another issue I'm having (and had it before i did all this too) is that often MDX won't close. If i exit roadrunner it stays open and if i right click on the tray icon and choose close it won't close.

                      Also after it does close i have to open and close it a bunch of times to get it to function at all. like none of the buttons work doesnt see anything in inputs. Maybe a driver issue? I have the latest ones but an older board.

                      And recently ive notice whether its work or its not when its open it uses 92%-99% of my processor power... Any ideas?

                      Comment


                      • #12
                        While reading through the Fusion forums trying to figure out what could be causing these problems that of it seeming to not see the brain and weird things happening I came across
                        Originally posted by 2k1Toaster View Post
                        We have a known problem (with no known solution) with non Intel 82801 controllers and I have no idea why. The only computers I can get my hands on and the same with Tim all use the 82801 and work fine. All the computers at our universities and all of our personal computers use this chipset so it must be very popular and it works fine.
                        I was running a Intel D201GLY2A board which this thread was discussing, and that lead me to think it was an issue with the USB controller. Of course I used this as part of my excuse to upgrade and I went with the Intel DG45FC board with a core2duo processor. That board has the controller that yous say works well with the brain.

                        Sure enough I got it in, did a fresh install of XP and loaded up all the Fusion and RoadRunner stuff just as I had it on the other system and it seems to work flawlessly. No more high CPU usage.. runs only a few percent at times.. no having nothing work when the program starts and it closes every time I tell it to also. So far looks good.

                        Comment

                        Working...
                        X