Announcement

Collapse
No announcement yet.

Where do I even start??

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

  • Where do I even start??

    I got the Fusion Brain v6. I am trying to use this to control the HVAC in my car. I know I will use relays and the outputs to turn on and off the blower motor speed etc. But I don't know where to even begin programming. I am not a programmer, so this will be a VERY large learning curve I'm sure. so I appologize in advance for my novice questions and comments.

    Where do I even begin. I insalled a trial version of Microsoft Visual 2012 thinking I would need it to program with, but wasn't sure. the program that I downloaded from FusionBrain seems very rudementary and not many options (but me saying that is probably mostly a slam to myself for not knowing what the heck I'm doing).

    If anyone is willing to give me some guidence that would be appreciated. like I said, I'm not a programmer, so code etc doesn't mean much to me right now without an explanation of what its telling the brain (the Fusion brain not mine) to do.

    I did search, but a lot of what I have found doesn't make much sense yet. I will keep perusing, because I know this has been done before...

  • #2
    OMG I figured it out! I was looking at it all wrong. I used FuseGL to create my buttons, on/off etc. then I am using Visual Studio Express (however notepad works too I hear, but I like Visual studio because it shows you errors before you save) to edit from there.

    for example, I want an image for a background... I add that code using Visual Studio. I will be looking into more advanced functions with buttons here, but for now at least I'm moving. I found the below thread helpful for making edits to my program.
    http://www.mp3car.com/fb-skins/15361...of-fusegl.html

    Basically, create the basics in FuseGL, then use Visual Studio to edit the .XML file located in the FuseGL folder (FuseGL\Config\UserGUIConfig.xml)

    Comment


    • #3
      Originally posted by jjohnston View Post
      I got the Fusion Brain v6. I am trying to use this to control the HVAC in my car. I know I will use relays and the outputs to turn on and off the blower motor speed etc. But I don't know where to even begin programming. I am not a programmer, so this will be a VERY large learning curve I'm sure. so I appologize in advance for my novice questions and comments.

      Where do I even begin. I insalled a trial version of Microsoft Visual 2012 thinking I would need it to program with, but wasn't sure. the program that I downloaded from FusionBrain seems very rudementary and not many options (but me saying that is probably mostly a slam to myself for not knowing what the heck I'm doing).

      If anyone is willing to give me some guidence that would be appreciated. like I said, I'm not a programmer, so code etc doesn't mean much to me right now without an explanation of what its telling the brain (the Fusion brain not mine) to do.

      I did search, but a lot of what I have found doesn't make much sense yet. I will keep perusing, because I know this has been done before...
      The software comes pre-configured with a small (extremely small) subset of things that can be accomplished with FuseGL. The backbone can do literally anything C# can do, which is everything a PC can do. And if you tie in C++ dll's and C dll's you can reference almost any piece of code written for a computer ever. So the power is there, but it is not even a fraction of a percent exposed through examples as you are finding out.

      You might want to look here: http://www.mp3car.com/fb-skins/15361...-new-post.html

      It has a couple quick things.

      Because there is so much to explain I generally approach this question with a "what do you want to do" question and give an answer rather then accept your "what can be done" and provide an answer that would use up all the server space available.
      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
        Are you using an Atom processor for the brain or something x86 derived?

        Curious since C# requires you to either use .NET with a MS OS or mono with Linux.

        Comment


        • #5
          I'm running a 32 bit version of Windows 7 starter. Yes, it is the Atom.

          Comment


          • #6
            I posted a few questions in the tutorials section.

            Comment


            • #7
              Anyone know where I can get a list of xml commands to use for the fusionGL? My latest road block is... Can't figure out how to make the fan speed buttons 1 on at a time. Don't know if I code that in xml or c# or what to do...

              Comment


              • #8
                I will try to have a response for you tonight.
                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


                • #9
                  OH, thanks! that would be really cool.

                  Comment


                  • #10
                    Originally posted by jjohnston View Post
                    Anyone know where I can get a list of xml commands to use for the fusionGL? My latest road block is... Can't figure out how to make the fan speed buttons 1 on at a time. Don't know if I code that in xml or c# or what to do...
                    Take a look at this: http://www.mp3car.com/fusion-brain/1...ml#post1483646
                    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


                    • #11
                      Thanks! That helps a lot! Now if I wanted the image to change on the digital output setting (on or off) would that be instead of "Image_hover" or "Image_Click" would I code it as "Image_On" or "Image_Off"?

                      Comment


                      • #12
                        Originally posted by jjohnston View Post
                        Thanks! That helps a lot! Now if I wanted the image to change on the digital output setting (on or off) would that be instead of "Image_hover" or "Image_Click" would I code it as "Image_On" or "Image_Off"?
                        I think you should be doing this in a custom cs file, not in XML. It will get ugly fast in XML.

                        I have implemented something real basic for you here. It requires the latest version, 1.1.0.469. If you don't have that version then open FuseGL and let it update. Then do the changes below. You can tell what version you have because it is the first line in the trace output.

                        Add this to your UserGUIConfig.XML

                        Code:
                          <User_Object type="FuseGL_Object">
                            <setting type="string" name="GL - HVAC CONTROL - FAN SPEED INDICATOR" />
                            <image location="internal" path="NULL" />
                            <size width="200" height="200" />
                            <location x="300" y="50" alignment="left" z="0.0" />
                            <setting type="bool" mouse_cursor_to_hand_on_hover="true" />
                            <events>
                              <startup action="FuseGL.ExecuteCode" inputArgs="Logic/ExternalExamples/HVAC_Example.cs;HVAC_Example.HVAC_Example;setup_HVAC;{this};{FB.DigitalOutput(0.1)};{FB.DigitalOutput(0.2)};{FB.DigitalOutput(0.3)};{FB.DigitalOutput(0.4)};" />
                            </events>
                          </User_Object>
                        Then put the file "HVAC_Example.cs"in the directory "Logic/ExternalExamples": http://www.fusioncontrolcentre.com/F...VAC_Example.cs

                        Code:
                        using System;
                        using System.Collections.Generic;
                        using System.Linq;
                        using System.Text;
                        using FB_USB_2011;
                        using FuseGL.GUI;
                        
                        namespace HVAC_Example
                        {
                            public class HVAC_Example
                            {
                                public enum FanSpeed
                                {
                                    OFF,
                                    LOW,
                                    MEDIUM,
                                    HIGH
                                }
                        
                                internal class MyInternalHVAC_FanSpeed_Class
                                {
                                    public FB_Monitor.DigitalOutputPort DigitalOutputPort;
                                    public FuseGL.GUI.FGLO_Texture FGLO_Texture;
                        
                                    public MyInternalHVAC_FanSpeed_Class(FB_Monitor.DigitalOutputPort digitalOutputPort, FGLO_Texture fgloTexture)
                                    {
                                        DigitalOutputPort = digitalOutputPort;
                                        FGLO_Texture = fgloTexture;
                                    }
                                }
                        
                                internal Dictionary<FanSpeed, MyInternalHVAC_FanSpeed_Class> FanSpeedLookupDictionary = new Dictionary<FanSpeed,MyInternalHVAC_FanSpeed_Class>();
                                internal FanSpeed currentFanSpeed = FanSpeed.OFF;
                        
                                public void setup_HVAC(
                                                        FuseGL.GUI.FuseGL_Object displayFuseGL_Object_for_fan_speed,
                                                        FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_off, 
                                                        FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_low, 
                                                        FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_medium, 
                                                        FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_high
                                                      )
                                {
                                    // Setup FanSpeed textures and ports
                                    FanSpeedLookupDictionary.Add(FanSpeed.OFF, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_off, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___OFF", "images/HVAC/FanSpeed/Off.png")));
                                    FanSpeedLookupDictionary.Add(FanSpeed.LOW, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_low, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___LOW", "images/HVAC/FanSpeed/Low.png")));
                                    FanSpeedLookupDictionary.Add(FanSpeed.MEDIUM, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_medium, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___MEDIUM", "images/HVAC/FanSpeed/Medium.png")));
                                    FanSpeedLookupDictionary.Add(FanSpeed.HIGH, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_high, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___HIGH", "images/HVAC/FanSpeed/High.png")));
                        
                                    // Hook into when the FGLO is pressed
                                    displayFuseGL_Object_for_fan_speed.MouseEvent___ClickDown += new FuseGL_Object.FuseGL_FGLO_MouseEvent(ChangeHVAC_FanSpeed_Button_Was_Pressed);
                        
                                    // Change the image to something known to begin with
                                    ChangeFanSpeed(currentFanSpeed, displayFuseGL_Object_for_fan_speed);
                                }
                        
                                void  ChangeHVAC_FanSpeed_Button_Was_Pressed(object sender, FuseGL.FuseGL_GUI.MouseEventInformation MouseInfo)
                                {
                                    switch(currentFanSpeed)
                                    {
                                        case FanSpeed.OFF:
                                            currentFanSpeed = FanSpeed.LOW;
                                            break;
                                        case FanSpeed.LOW:
                                            currentFanSpeed = FanSpeed.MEDIUM;
                                            break;
                                        case FanSpeed.MEDIUM:
                                            currentFanSpeed = FanSpeed.HIGH;
                                            break;
                                        case FanSpeed.HIGH:
                                            currentFanSpeed = FanSpeed.OFF;
                                            break;
                                    }
                        
                                    ChangeFanSpeed(currentFanSpeed, (FuseGL.GUI.FuseGL_Object)sender);
                                }
                        
                                public void ChangeFanSpeed(FanSpeed _speed, FuseGL.GUI.FuseGL_Object fanSpeedFGLO = null)
                                {
                                    // Put some info in the trace for debugging perhaps?
                                    FuseGL.FuseGL_Debugger.Trace.Add("Changing Fan Speed to: " + _speed);
                        
                                    // First turn off all the outputs
                                    foreach(KeyValuePair<FanSpeed, MyInternalHVAC_FanSpeed_Class> aFanSpeed in FanSpeedLookupDictionary)
                                    {
                                        aFanSpeed.Value.DigitalOutputPort.Value = FB_Monitor.DigitalOutputPort.DIGITAL_OUTPUT_OFF;
                                    }
                        
                                    // Then if it is a valid fan speed and the dictionary has been setup properly...
                                    if(FanSpeedLookupDictionary.ContainsKey(_speed))
                                    {
                                        // Turn that output on
                                        FanSpeedLookupDictionary[_speed].DigitalOutputPort.Value = FB_Monitor.DigitalOutputPort.DIGITAL_OUTPUT_ON;
                        
                                        // If the FGLO to display a picture in is valid...
                                        if (fanSpeedFGLO != null)
                                        {
                                            // Change the texture to the correct one depicting the new fan speed
                                            fanSpeedFGLO.TextureIsBeingOverriddenAndControlledExternally = true;
                                            fanSpeedFGLO.TextureToOverrideWith = FanSpeedLookupDictionary[_speed].FGLO_Texture;
                                        }
                                    }
                                    return;
                                }
                            }
                        }
                        Also make sure to copy these images into the directory "images/HVAC/FanSpeed" (you will need to create it)
                        http://www.fusioncontrolcentre.com/F...ample/High.png
                        http://www.fusioncontrolcentre.com/F...ple/Medium.png
                        http://www.fusioncontrolcentre.com/F...xample/Low.png
                        http://www.fusioncontrolcentre.com/F...xample/Off.png

                        and the PSD if you want it: http://www.fusioncontrolcentre.com/F...Images_PSD.psd

                        Then when you run it, you will see a big ugly FuseGL Object drawn to the screen that changes the mouse to a hover when you hover. When you click it, it will rotate between Off-Low-Medium-High. It will also turn on and off the outputs you need when you do so as commented in the CS file.

                        It might be best at this point for you to see it, then ask me questions if you don't get it rather than me trying to explain it.

                        Also you can download the Visual Studio Solution here I used to make it: http://www.fusioncontrolcentre.com/F...tomCS_File.zip
                        Make sure to update the *.exe and *.dll that are used as references to the newest versions as they come out to keep them in sync.




                        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


                        • #13
                          Here is the full breakdown: http://www.mp3car.com/fb-documentati...mentation.html
                          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


                          • #14
                            That's weird. for some reason I try it, but all I get is a blank FuseGL screen. I downloaded your images, and your .cs file to the proper locations... and made no changes to them, just ran them as they downloaded.

                            Comment


                            • #15
                              Originally posted by jjohnston View Post
                              That's weird. for some reason I try it, but all I get is a blank FuseGL screen. I downloaded your images, and your .cs file to the proper locations... and made no changes to them, just ran them as they downloaded.
                              Did you modify the UserGUI xml file?

                              Post your trace if you did and it is just blank.
                              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

                              Working...
                              X