Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

unity&aruduino&SG90

Discussion in 'General Discussion' started by ku01218, Jul 29, 2020.

  1. ku01218

    ku01218

    Joined:
    Jul 29, 2020
    Posts:
    4
    I want to control the servo motor (SG90) by linking unity and aruduino.
    In particular
    Click on unity to move the servo motor from 0 to 120 → stop
    If you click on unity, the servo motor will move from 120 to 0 → stop
    I want to make a mechanism like that.

    If anyone knows how to do it, I would really like to know it specifically.
    Thank you.
    upload_2020-7-29_18-58-43.png
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    8,067
    Google "C# communicate with arduino".

    This will land you on page describing how to send data to arduino from C# program.

    Then it is a matter of writing two tiny programs...
     
  3. ku01218

    ku01218

    Joined:
    Jul 29, 2020
    Posts:
    4
    thank you !
    but,it is difficult for me.
    so,would you write a simple example?
    pleaseplease.
     
  4. ku01218

    ku01218

    Joined:
    Jul 29, 2020
    Posts:
    4
    thank you !
    but,it is difficult for me.
    so,would you write a simple example?
    pleaseplease.
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    8,067
    No.

    Read tutorials and learn how to do it. Controlling servos through arduino is very easy.
     
    Martin_H likes this.
  6. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,105
    You seem to struggle with C#, check this out:

    http://www.csharpcourse.com/
     
  7. sxa

    sxa

    Joined:
    Aug 8, 2014
    Posts:
    431
    What circumstances have put you in the position where you need to do such a thing, but do not have the basic skills required to even start doing so for yourself?
     
  8. ku01218

    ku01218

    Joined:
    Jul 29, 2020
    Posts:
    4
    oh my god
    i can control servo through arduino. i know this way to.
    but,i don,t know how to connect unity and arduino.
    i want to connect unity and arduino.
    i want to make a program to rotate the servo motor through arduino when i click on unity.
    please tell me how to way.
     
  9. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    8,067
    Like I said:

     
    zombiegorilla and ku01218 like this.
unityunity