Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Uniduino - Arduino for Unity

Discussion in 'Works In Progress - Archive' started by edwon, Dec 27, 2012.

  1. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    I found UnityOSC but have not tried it yet. - https://github.com/jorgegarcia/UnityOSC.

    Any plans to support Firmata over ethernet? - google finds a few implementations.

    iByte
     
  2. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    No plans for Firmata over ethernet at the moment, but once again that does seem like a good idea for the next update (especially if more people request it)!
     
  3. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    firmata over ethernet looks good count me in !
     
  4. jman12

    jman12

    Joined:
    Feb 10, 2013
    Posts:
    103
    Hello edwon. I am curious as to what type of bulbs you used for the light flicker effect in the demo video? Would it be hazardous to use other bulbs?
     
  5. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    Yo Jman,

    We used Edison type bulbs in the video. We happened to have them sitting around and thought they would look creepy so we decided to use em! You could use any light of any kind though. Unidunio is all about trying new things so go crazy! As for safety, it would probably not be good to have lights like that flickering for hours on end, if you wanted to have a permanent installation I'd suggest finding lights designed specifically for that purpose. I'm not a safety expert though so just use discretion and be careful out there.

    - Edwon
     
  6. kodagames

    kodagames

    Joined:
    Jul 8, 2009
    Posts:
    548
    Hey Edwon,

    Thanks for getting back to me. So its unfortunate that it will not work with smartphone or tablet devices.

    Does or will it work from a web application or in unity terms web build that has been compiled uploaded to the internet?
    Also how about standalone builds? I just want to make sure it doesn't only work from the Unity IDE.

    I cant wait to get my arduino kit to start toying around :)

    Sincerely,
    Michael
     
  7. John-Higuera

    John-Higuera

    Joined:
    Oct 14, 2012
    Posts:
    20
    Hello Edwon,

    We buy this great asset, we have just acquired a board Mega2560 R3 ATmega2560-16AU,,, also some GY-521 Gyro+Acelerom,, the thing is that in the Arduino software we follow your setup tutorial and only connecting the board, it works flawless on the port COM5.

    The situation is when I try it on unity and after installing the drivers, when I run the UniduinoTestPanel Scene, the panel is trying to access the COM3, therefore there is an error that says “The device is not connected”.

    In few words, Arduino software find the board in a COM5 and without changing anything Unity is trying to access it on COM3 and throw and error.

    I’m using the latest Unity Pro version, windows 8 64 bits, Arduino 1.0.5, tha latest Uniduino and Mega2560 R3 Board.

    Any advice on this!
    Thank you!
     
    Last edited: Oct 11, 2013
  8. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    Hi Michael,

    We have never done a web application using Uniduino, but we have done stand alone Mac/Pc builds that do work. Make sure to post with what you have in progress!

    - Edwon
     
  9. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    Hi John,

    Have you tried pressing the "guess" button in the Uniduino Control Panel? This will change the port. You can also change the port on the Uniduino prefab object in your scene until you have selected the correct one.

    - Edwon
     
  10. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    You can also changd the port numder of the arduino from 5to 3 in the control panel.
    Select the arduino from the devices and right click to select properties then select advanced settings.
    You can change the port number to 3.
     
  11. John-Higuera

    John-Higuera

    Joined:
    Oct 14, 2012
    Posts:
    20
    Hi Edwon and John G,
    Thanks for your quick answer. Both suggestions works, thank you very much!

    NOTE: I tried the "guess button" in the past but it didn't change the port, maybe something to do with my laptop. So one way to solve this was to change the port in the Control Panel (Ports COM LPT in the Arduino Device) as John G suggest, and change it for the one that I saw listed in Unity during the scene UniduinoTestPanel. But the other way that is the one that I actually used, was the Edwan suggestion, I actually Turn off the AutoConnect option on the script (Arduino in the Scene UniduinoTestPanel) and write down the name of the port (in my case COM5), then after press PLAY in unity, I just press "Connect" button and it connect with no problem.

    Thank You!
     
  12. kodagames

    kodagames

    Joined:
    Jul 8, 2009
    Posts:
    548
    @ Edwon
    Its good to know that you can do PC/Mac standalone builds :) Have you done anything with bluetooth? (if so mobile may not be too far off?)

    @ ibyte
    How easy / difficult is it to use OSC for building an interface for smart devices?

    I wish I could use Unity because Im already familiar with it (creating interfaces is easy) but my main goal is to use smart devices with arduino projects so I may have to go the OSC way.

    Sincerely,
    Michael
     
    Last edited: Oct 22, 2013
  13. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    :( Still haven't managed to get there yet ....

    iByte
     
  14. kodagames

    kodagames

    Joined:
    Jul 8, 2009
    Posts:
    548
    I appreciate the response ibyte :) if I get there before you Ill let you know how I make out if you like.
     
  15. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,817
    Hey did you guys manage to get this working with a mobile device? I have a project I'd love to get working with this.
     
  16. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    Guys any news for uniduino working with mobile over wifi?
    i asked on uniduino forum but everyone is asleep...
    cheers
     
  17. AlwaysBeCoding247

    AlwaysBeCoding247

    Joined:
    Jan 27, 2014
    Posts:
    41
    Have to look into this. Two of my favorite toys, Arduino and Unity, playing together? Very interesting
     
  18. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,249
    Does this support lilypad?
     
  19. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    have not tested lilypad ...but since it can load firmata i don't see why not...
     
  20. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Any tips what kind of arduino kit to buy, to use this with gyro..?
     
  21. jonlab

    jonlab

    Joined:
    Apr 6, 2010
    Posts:
    182
    The simpler of most available is the Arduino UNO.
    What kind of gyro do you want to connect ? (you'll find SPI/I2C or analog ones, I think).
     
  22. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
  23. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    Hello , ooh this looks like fun :)

    ok so im just about to buy this but then with my growing experience in hasty purchases i thought i should perhaps check some details with you guys first, so i would like to use this to control a relay board for some home automation controlling 10 amp 240v devices, i would like to have it with a usb cable going to the relays, so my questions are

    1, is this possible with your kit using the playmaker actions
    2, could you suggest a relay board that will be compatible

    many thanks
     
  24. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,249
    Do you know of anyway to upload programs to the board directly?
     
  25. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    Some info after testing,
    - Arduino Uno
    - Tinkerkit shield
    - Tinkerkit Gyro

    Everything works ok (and uniduino plugin is great)

    Only problem with this kind of simple setup is gyro drifting..
     
  26. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    Hey x_ming_x,

    Yes this should be possible using Playmaker and relays. We used a relay connected to an Arduino Uno to make the lamps flash in the Uniduino trailer video.

    I can't recommend a relay board though as I'm not that knowledgeable about them! I would check the arduino.cc forums as they have tons of info and recommendation about hardware.

    Hope that helps!

    - Edwon
     
  27. nidhalkratos

    nidhalkratos

    Joined:
    Aug 9, 2014
    Posts:
    1
    Hey, Uniduino is a great tool for controlling Arduino using unity3d but for those who want to learn things from scratch or who just can't pay for it here is a gift to you

    Please tell me if i helped :)
     
  28. hubatish

    hubatish

    Joined:
    Jan 22, 2014
    Posts:
    5
    Does anyone know if this works for Android?
     
  29. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
    How to make it works with I2C? I want to make get data from hmc5883l magnetometer sensors but i stuck in I2C part. If possible, i want to make it connect to more than one hmc5883l magnetometer sensors
     
  30. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Does anyone know if it's possible to implement something like this with the Uniduino plugin?

    The guy reads in the light sensor data from the Arduino to the PC, and then adjusts the brightness from there.
     
  31. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Currently, I have the Arduino setup with the Sketch IDE, I'm reading in it's data to a port, then I access that port in Unity to read the values. Does this plugin remove the step of having to use the Sketch IDE?