Search Unity

Uniduino - Arduino for Unity

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

  1. rlmg

    rlmg

    Joined:
    Mar 15, 2013
    Posts:
    5
    Awesome work Edwon. I can't wait to get my hands on this.

    Any chance it'll be out in the next week or so? I have a museum exhibit that installs in two weeks and this would really help clean up a bunch of software clutter.

    Can't Wait! :)
     
  2. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Exciting news! Lazer and I just submitted Uniduino to the Unity Asset Store for approval! We are unbelievably excited to have this almost completed. They said it would be about a week until we know if it's approved or not.

    We also just finished the website, tutorial videos, documentation, and forum. Feel free to check it out at uniduino.com

    Let us know what you think of the new site and impending release of Uniduino! I, personally can't wait to start using it!

    - Edwon
     
  3. TechDevTom

    TechDevTom

    Joined:
    Oct 21, 2011
    Posts:
    33
    Awesomes, I've taken a quick look at the website and think it's a great start. I'll have to go out and get myself an Arduino now, been reading through the help pages on the Arduino.cc for the past week or so and everything looks easy enough to do. I'll join up to the forums and ask any questions I have there. Thanks for adding me on Skype btw, look forward to chatting =)
     
  4. agamedesigner

    agamedesigner

    Joined:
    Jul 21, 2012
    Posts:
    19
    Looking forward to this
     
  5. rlmg

    rlmg

    Joined:
    Mar 15, 2013
    Posts:
    5
    I'm thrilled to hear this. I can't wait to try it out.

    The site looks great too. One minor thing worth noting is that the lightbox for the YouTube video doesn't scale well on the iPhone (4s at least).

    Keep going strong.
     
  6. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Just to state, you can use a C# socket connection to talk to the arduino through usb. I posted code to do it a while ago. I posted this a few years ago, so anyone can try it out. Their system will probably easier to use, but just reading serial data isn't that hard to do.

    http://forum.unity3d.com/threads/45477-Unity3d-Arduino-(Read-serial-in-Unity3d)

    It doesn't use any type of handshaking (which I did end up using in the end, but I don't think I ever posted it). Problem with the code in that post is that it doesn't handshake, so it randomly doesn't get the proper data, and can sometimes get partial data. If you do a simple hand shake, with a specific end character (like @) to say it's the final bit of data, then it should work quite well.

    That all said, I think that the Unity people said they were making the c# sockets a pro feature or something like that, so my scripts would probably only work on older versions of unity (3.4 and earlier, cause I think they said that they were doing the pro feature thing in like 3.5.4 or something like that)

    Either way, if you want to put in the effort more, you can use my code, or wait for theirs. It's been out since 2010 though, so fair game.

    EDIT:
    I did end up posting some of the handshaking stuff on the arduino forums here: http://arduino.cc/forum/index.php/topic,40001.0.html#3
     
    Last edited: Mar 19, 2013
  7. lazer

    lazer

    Joined:
    Aug 15, 2012
    Posts:
    11

    Thanks for pointing this out. This is the route we went first, of course, but we soon began to hate our lives. We use OSX primarily, so SerialPort isn't even available to us in Unity's version of mono. After we wrestled that problem to the ground, we still had no easy way of programmatically wiring our games to our dishwashers and sewing machines, to say nothing of the array of microelectrodes I implanted in edwon's brain while he was passed out on my couch.

    So we went out and found some Firmata client code and started improving it to the point it could actually be used. By the time we were done, we had wasted days on something that should have taken minutes. In our relentless quest to banish all inspiration-killing soul-devouring work from the realm of game development, Uniduino was born. We wrapped up all the tedious hacking we did in a slick little package that literally gets you up and running in minutes rather than hours.

    We think it will save you precious time, and we're here to support it and make it better.

    lazer
     
  8. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Yeah, my method lacks a lot of features, I was just throwing it out there for people that wanted to mess with it while waiting.
     
  9. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    246
    Awesome! Great News! Cant wait to play with it!
     
  10. Axtel_Sturnclaw

    Axtel_Sturnclaw

    Joined:
    Oct 10, 2012
    Posts:
    124
    I am also looking forward to this package's release!

    I will most likely be getting this soon after it comes out on the asset store.
     
  11. aroOon

    aroOon

    Joined:
    Mar 19, 2013
    Posts:
    5
    Yes, this is exciting! Would like to keep updated.
     
  12. super777

    super777

    Joined:
    Mar 21, 2013
    Posts:
    1
    I'm stoked! Hopefully this gets released within the week. My group and I are in an Immersive Environments class and this would make our project so much more complete.
     
  13. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    We submitted Uniduino for approval on March 16 and are STILL waiting for a response. Why so slow Unity gods?! I'm so sorry everyone has had to wait so long!
     
  14. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    edwon how about we send you a paypal payment and you send us the package ?
    will it work with unity basic or does it need pro ?
     
  15. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Uniduino works with basic and pro versions of Unity. Still waiting for word from Unity. I'm considering setting up some sort of payment system for those of you who would like it beforehand. I'm at GDC right now though so I won't have time until the end of the week most likely. Anybody here at GDC who'd like to meet up I'm totally down!
     
  16. nRp

    nRp

    Joined:
    Jan 22, 2013
    Posts:
    2
    do you guys have any update on the asset store or alternate route?
     
  17. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Just to let you guys know, according to the RSS feed, it's in the store. That said, it doesn't show up in the search, and clicking the link in the rss just brings you back in to the rss, but it should be up in the next hour or so with the working link.

    EDIT:
    Nevermind, It's up fully now:
    https://www.assetstore.unity3d.com/#/content/6804
     
    Last edited: Apr 2, 2013
  18. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Last edited: Apr 2, 2013
  19. lazer

    lazer

    Joined:
    Aug 15, 2012
    Posts:
    11
    At long last!
     
    Last edited: Apr 2, 2013
  20. rlmg

    rlmg

    Joined:
    Mar 15, 2013
    Posts:
    5
    Up and running in no time on OSX.

    I did have a minor hiccup at first where Unity was reporting a couple of errors with the Arduino.Firmata.cs and the 'Ports' and 'SerialPort' namespaces. I fixed this by changing the "API Compatibility Level" from ".Net 2.0 Subset" to ".Net 2.0" and restarting Unity.

    This is a problem that is common with Unity and serial ports; it is not unique to Uniduino.
     
  21. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Hey rlmg,

    Glad your enjoying! Good point about the .Net 2.0 thing, I'll be sure to add a note about this on uniduino.com

    Can't wait to see this museum thing, be sure to post some pictures on the uniduino.com forum once you have something to show! And of course feel free to ask questions on there if you run into any problems and Lazer or I will answer as fast as possible.

    - edwon
     
  22. rlmg

    rlmg

    Joined:
    Mar 15, 2013
    Posts:
    5
    Install is tomorrow. I have some other bugs to work out first, but I'm going to try to get Uniduino in along with the rest of the fixes. Right now I have a Java app standing between the Arduino and my Unity app (I couldn't get Unity and the Arduino to communicate properly with my home-brew c# code).

    At any rate, I'll let you know how it goes.

    Also, the .Net 2.0 thing will need to be done on both OSX and Windows.
     
  23. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    Ok Purchased !
    I am on osx 10.7.5 with unity 4.1.2 so i uploaded the firmata sketch on an arduino uno r2 opened the test panel scene and i get these errors:

    Assets/Uniduino/Scripts/Arduino.Firmata.cs(35,17): error CS0234: The type or namespace name `Ports' does not exist in the namespace `System.IO'. Are you missing an assembly reference?
    Assets/Uniduino/Scripts/Arduino.Firmata.cs(80,17): error CS0246: The type or namespace name `SerialPort' could not be found. Are you missing a using directive or an assembly reference?
    Assets/Uniduino/Scripts/Arduino.Firmata.cs(35,17): error CS0234: The type or namespace name `Ports' does not exist in the namespace `System.IO'. Are you missing an assembly reference?

    i use the full .net not subset

    any ideas ?

    [ EDIT ]

    hmmm...
    ok no need to reply i solved it..
    after two restarts and a succesfull install it works ok
    happy hardware hacking...;)
     
    Last edited: Apr 5, 2013
  24. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Are you on Mac or PC? If on a mac, you need to go to Window > Uniduino, a little pop up comes up, press "Install Serial Support for OSX"
    and that should resolve the issue, if on a PC then I'm not sure exactly what the problem is, I'll have to consult Lazer
     
  25. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    you are superfast Edwon..you replied before my edit :) thanks buddy !
     
  26. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    We're working on an update to resolve that specific issue, a few people have ran into it. We're also going to make it work for Unity 3.5 and up(or maybe even 3.0 and up)
     
  27. rlmg

    rlmg

    Joined:
    Mar 15, 2013
    Posts:
    5
    In my experience, the restart is the critical part after switching to .Net. For some reason Unity doesn't seem to be able to change between the .Net Subset and regular .Net libraries.
     
  28. trelobyte

    trelobyte

    Joined:
    Nov 17, 2010
    Posts:
    54
    Is it possible to include some examples for pwm and servo control in the update ?... i am not very familiar with firmata..
    thanks
     
  29. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Yeah, I can make a little tutorial for controlling a servo with PWM. Anybody else out there interested in that?
     
  30. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    246
    i just bought it! Works perfectly on an Arduino Leonardo board with a Tinker Kit shield! Just had to figure out the pins for the tinkerkit.
    some more tutorials / examples would be awesome :)

    and how would you fade a LED light?
     
    Last edited: Apr 7, 2013
  31. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    hey propeller, working on an LED fade tutorial right now. For now this tutorial from the Arduino website can set you in the right direction. We have the equivalent of AnalogWrite in Uniduino so it should be pretty easy to get going!

    http://arduino.cc/en/Tutorial/Fade
     
  32. SanTeix

    SanTeix

    Joined:
    Apr 27, 2013
    Posts:
    1
    Hi Edwon, some news ?
    I can't wait for new tutorials !
     
  33. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    369
    Servo or stepper motor control would be really great to see... maybe a few NGUI sliders operating the servos.
     
  34. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    369
    Is this thread still alive ... ?? I notice there's been no real action here for a few weeks... Perhaps there's a more active thread or forum going on ?

    I'm thinking of purchasing the asset.. but would like to see how much interest is being generated first ...
     
  35. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
  36. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    369
    I think this asset would do well with a a few examples... physical examples, like servo controlled robots etc...
     
  37. seatts

    seatts

    Joined:
    May 26, 2013
    Posts:
    1
    Has anybody been successful in using the Uniduino for input? I've been trying to get the analogRead function working but am not having a lot of luck, I've had no trouble with output (largely because there are tutorials available).

    Does anyone have a script (that uses analogRead) that I could look at? I'm fairly new to c# but I think I'd be able to figure it out if I saw somebody elses code.

    Thanks in advance
     
  38. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    369
    Last edited: Jun 2, 2013
  39. deram_scholzara

    deram_scholzara

    Joined:
    Aug 26, 2005
    Posts:
    1,030
    Oh man, this would have made one of my old projects so much easier for us. We had a flight simulater using bladeless Dyson fans to simulate the direction that you're moving through the air. Our hardware collaborators used Arduino devices to hook into each fan and smoothly control each one's velocity.

    http://vimeo.com/53889603
     
    Last edited: Jun 2, 2013
  40. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    The bird simulator looks incredible! I would love to play that game deram!
     
  41. scottstephan

    scottstephan

    Joined:
    Nov 1, 2012
    Posts:
    5
    Really, that sound totally insane. Like it was conceived by a mad man and implemented by his team of his worker slaves and then dragged all over California. But thats just what it sounds like to this guy you've never met before.

    Anyhow- Hopping into Uniduino today! Hoping to use it to capture some data from an exercise bike rider. I'll letcha know how goes!
     
  42. jonlab

    jonlab

    Joined:
    Apr 6, 2010
    Posts:
    182
  43. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Jonlab! Your project looks amazing! Great work!
     
  44. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    Uniduino 1.2 has arrived on the asset store! We've got tutorials, playmaker support, and bug fixes. First up...

    NEW TUTORIALS!
    I decided to try a new format for the tutorials (text interspersed with gifs) It combines the speed of text tutorials with the visual clarity of video. I think it's pretty awesome, but let me know what you think on this thread!
    http://www.uniduino.com/tutorials/

    Using a Servo
    http://www.uniduino.com/kb/servo/

    Using a Potentiometer with analogRead
    http://www.uniduino.com/kb/potentiometer/

    Using a Button with digitalRead
    http://www.uniduino.com/kb/button/

    PLAYMAKER!

    Now you can use Uniduino with Playmaker! No programming required! The custom actions are included in the asset store package. Check out the tutorial below.

    Playmaker
    http://www.uniduino.com/kb/playmaker/
     
  45. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
  46. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
  47. emergki

    emergki

    Joined:
    Oct 15, 2007
    Posts:
    419
    Bought!

    Now I need an Arduino!
     
  48. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    Really nice. We are already working with Arduino with another solution, I will try this one also now =)
     
  49. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,016
    Dang, missed that daily deal. :(

    Does anyone know if there a mailing list for the daily deal?

    Does this package support OSC?

    iByte
     
  50. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    221
    There's no mailing list for Unity Daily Deals as far as I know, but you can follow the Unity Asset Store on Twitter, they usually post the daily deals: @UnityAssetStore

    Uniduino does not support OSC at this time, if enough people request it we'd be happy to add! It would likely be better for someone to write a separate asset store plugin that provides an OSC in/out library. Hmmm, that might be an interesting idea!
     
unityunity