Announcement

Collapse
No announcement yet.

UE4Duino - Arduino to UE4 plugin Release!

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

    [MENTION=77505]John Michael[/MENTION]

    AC motors' speed is controlled by placing different value capacitors in series with the winding, what you can do is setup few relays and transistors and use them to switch in different capacitors to vary the speed.

    Comment


      Hello Grizly

      Thank you for this great contribution,

      I have not been able to use this plugin, I'm using UE4.11

      I can know a date when you release the version for UE4.11 ?

      We would all be very grateful

      Comment


        Hi I am bringing in a heart rate reading from a polar heart monitor via arduino into unreal.
        I would like to establish an average heart-rate over a 60 second duration.
        I am using a baud rate of 9600 with 1000ms between readings.
        Is there anyway to have a constant 'average heart rate per minute' being generated ?

        The arduino code I am using is:

        #define HR_PIN 7
        long hr = 0;
        long last_hr_ts = 0;
        long last_report_ts = 0;
        int report_delay = 1000; //Must be > 1000 miliseconds

        long samples[8] = {0}; //size was chosen since it's optimized in division and modulus
        byte last_sample = 0;
        long joeys_avg = 0;
        long joeys_hr_accumulation = 0;
        void setup()
        {
        pinMode(HR_PIN, INPUT);
        Serial.begin(9600);
        }
        void loop()
        {
        long current_time = millis();
        if (digitalRead(HR_PIN) == HIGH) {
        //First sample will be garbage, since last_hr_ts = 0
        //dt < 10 means the same sample. Otherwise it means hr of 6000bpm...
        //That's fast even for a colibri
        if (current_time - last_hr_ts > 10) {
        byte next_sample = ((last_sample + 1) % 8);
        samples[next_sample] = current_time - last_hr_ts;
        last_sample = next_sample;
        }
        last_hr_ts = current_time;
        }

        if (current_time - last_report_ts > report_delay) {
        if (current_time - last_hr_ts < report_delay) {
        {
        long sum_samples = 0;
        byte i;
        for (i = 1; i < 9; ++i) {
        sum_samples += samples[((last_sample + i) % 8)]; //optimizes to (last_sample + 1)&7
        }
        sum_samples /= 8; //optimizes to sum_samples >>= 3
        /*To be accurate (2 digits), we multiply the sample by 100, and finally divide result */
        //hr = ((100000/(sum_samples))*60)/100;
        hr = (6000000/(sum_samples))/100;
        Serial.println(hr);
        }
        } else {
        Serial.println("Out of range");
        }
        last_report_ts = current_time;
        }
        }

        Comment


          Originally posted by dabulina View Post
          on win 10 this version https://drive.google.com/file/d/0B5Y...RzVG13dDg/view works on 4.11 for me.
          Create new document, c++ project, lunch it. Then close it. Next to project create folder Plugins, copy plugin in to this folder. Lunch project and editor will compile new plugin.
          Link appears to be down - any chance of a reupload?

          edit: here is the link https://drive.google.com/file/d/0B5Y...RzVG13dDg/view

          Comment


            rewrote the plugin to work when packaged(it's a project atm) the serial read works haven't tested the serial write.You have to set up your gameinstance to my custom one,if anyone wants to make it a plugin again(shouldn't be hard).
            https://drive.google.com/file/d/0B6r...ew?usp=sharing

            Comment


              Hey Velocityx,

              that is awesome! Did it only work when you programmed it with your gameinstance? Or will it now also work if I program a normal blueprint library again as the error was somewhere else?

              Comment


                Hi Velocityx,
                Well I just tried it, but the read is not working for me. At the begining the arduino value is read out correct, but after that it doesn't update anymore and the printstring commad results in the same number all the time. I set the baudrate to 115200 in the levelblueprint to match my arduino which worked fine in the other UE4Duino Plugin version... Any Idea?

                Comment


                  Hey! i'm having issues here aswell,

                  I see a diode flashing on my arduino board whenever i try to write to the serial from Unreal Engine, but i cannot get any data out of it.
                  And when i Serial.print("something") from the arduino, nothing appears when i use the Read Serial node in blueprint and try to print the string.
                  I see that the port opens correctly from the output log in UE. Tried with 4.10, 4.11 and 4.12, using win10.

                  Comment


                    I'm working on 4.10.4 and can't package the game, I must deliver it in 5 hours tops and can't do squat, I can't even generate c++ projects (it ask for a source folder each time I try to do it) for it for who know what reason and all of a sudden now UE4 asks me for VS2013 when I installed VS2015.

                    Manage to solve this, still won't package on final build: If someone ran into this issue and couldn't solve it, I advice you not to use this plugin for developing since it seems to be in beta to be fair.
                    Last edited by fdslk; 06-16-2016, 07:16 PM.

                    Click the tiny bird!
                    It'll take you to my stuff!

                    Comment


                      Originally posted by John Michael View Post
                      [MENTION=41593]Gabriel Lima[/MENTION]

                      I'd like to be able to control the RPMs as a function of the maximum speed of my ATV simulator.
                      You'd need to write a few functions to control speed with PWM and have something like a hall sensor to record your RPMs to adjust the speed.

                      Just be sure to power the fan with an external power supply(look up how to connect a 12v motor to an arduino).

                      Anyone have problems with this if using a Leonardo or Micro/Pro Micro?

                      Had to rewrite the serial class to make it work.

                      Comment


                        Hi so i've used this in a packaged project and it works,i will rewrite it again when i get a microcontroller cause i had to give mine up for a seperate project.I need to make it have a thread again(it's technically commented out and it's code has been put in the tick which might actually be why you are getting issues,it might has it's buffer getting filled too fast or etc. and because it's in the game thread the reading is slowed down,it might get hackfixed if you give a bigger delay for the messages but not sure).I will probably make it a real plugin and will make it not use the game instance,i was using it because the previous implementation was a *********** it was creating objects left and right just to make it run and tried to access a bp library object which when packaged does not actually exist
                        Last edited by KernelCrumpet; 06-28-2016, 06:37 AM.

                        Comment


                          That would be so awesome Velocityx! I'd gladly buy you an arduino if that would help?

                          Comment


                            i already bought microcontrollers, but they're on their way probably will take a week and something.

                            Comment


                              Hi guys,

                              I need some help to get the plugin working. I tried all available plugin versions I could find here with 4.12 and 4.11:

                              UE4Duino4.9
                              UE4Duino_4_10
                              UE4Duino_Plgin
                              UE4Duin-versieGidi

                              If I put one of this folders under C:\Program Files (x86)\Epic Games\4.12\Engine\Plugins\MyPlugins it always shows the same message: Plugin UE4Duino failed to load because module UE4Duino does not appear to be compatible with the current version of the engine. The plugin may need to be recompiled.

                              So I tried this:

                              [I]Hello guys,
                              I recompiled UE4Duino for 4.12Preview and it works.
                              So here is the short instruction how to do it by yourself:
                              1. Create new project in UE4.12
                              2. Add new C++ class (None->next)
                              3. Save project
                              4. Close it
                              5. Create folder "Plugins" in the project folder and put here UE4Duino plugin
                              6. Open again your project and UE will ask you to recomplile UE4Duino plugin - you should press YES.
                              7. When recompilation will be done, you can close UE and copy UE4Duino from that project to other project. It will work.[/]

                              I tried it again with all folders and both versions 4.11 and 4.12. It says The following modules are missing or build with a different version.. Would you like to rebuild them now?
                              If I hit yes, this comes up:

                              Error: ProjectTitle could not be compliled. Try rebuilding from source manually.

                              I'm using Win10 64bit. Can someone help?

                              Thanks

                              Comment


                                Originally posted by AronBaron View Post
                                Hi guys,

                                I need some help to get the plugin working. I tried all available plugin versions I could find here with 4.12 and 4.11:

                                UE4Duino4.9
                                UE4Duino_4_10
                                UE4Duino_Plgin
                                UE4Duin-versieGidi

                                If I put one of this folders under C:\Program Files (x86)\Epic Games\4.12\Engine\Plugins\MyPlugins it always shows the same message: Plugin UE4Duino failed to load because module UE4Duino does not appear to be compatible with the current version of the engine. The plugin may need to be recompiled.

                                So I tried this:

                                [I]Hello guys,
                                I recompiled UE4Duino for 4.12Preview and it works.
                                So here is the short instruction how to do it by yourself:
                                1. Create new project in UE4.12
                                2. Add new C++ class (None->next)
                                3. Save project
                                4. Close it
                                5. Create folder "Plugins" in the project folder and put here UE4Duino plugin
                                6. Open again your project and UE will ask you to recomplile UE4Duino plugin - you should press YES.
                                7. When recompilation will be done, you can close UE and copy UE4Duino from that project to other project. It will work.[/]

                                I tried it again with all folders and both versions 4.11 and 4.12. It says The following modules are missing or build with a different version.. Would you like to rebuild them now?
                                If I hit yes, this comes up:

                                Error: ProjectTitle could not be compliled. Try rebuilding from source manually.

                                I'm using Win10 64bit. Can someone help?

                                Thanks
                                try deleting the binary and intertmediate of the plugin,i do have to say the plugin won't work if you package if you want to you have to use my project that i posted above where it's posible to compile,the buffer is giving issues in it but you can compile it

                                Comment

                                Working...
                                X