Ejemplo n.º 1
0
    bool yellow = false;     //just have to make sure it starts the same as on the Arduino

    void Start()
    {
        arduinoConnector = GetComponent <ArduinoConnector>(); //to access properties of ArduinoConnector script
        arduinoConnector.Open();                              //open serial connection
        rend = GetComponent <Renderer>();                     //to access the renderer of the object
        rend.material.SetColor("_Color", Color.blue);         //set the color of the cube to BLUE
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        arm = GetComponent <GameObject>();

        wrist        = GameObject.FindObjectOfType(typeof(WristControl)) as WristControl;
        auriculaire  = GameObject.FindObjectOfType(typeof(AuriculaireControl)) as AuriculaireControl;
        ringFinger   = GameObject.FindObjectOfType(typeof(RingControl)) as RingControl;
        middleFinger = GameObject.FindObjectOfType(typeof(MiddleControl)) as MiddleControl;
        index        = GameObject.FindObjectOfType(typeof(IndexControl)) as IndexControl;
        thumb        = GameObject.FindObjectOfType(typeof(ThumbControl)) as ThumbControl;

        fingers = new List <Finger>();
        fingers.Add(auriculaire);
        fingers.Add(ringFinger);
        fingers.Add(middleFinger);
        fingers.Add(index);
        fingers.Add(thumb);

        tempFingerDegree = 255;

        connector = new ArduinoConnector();
        Debug.Log(connector.port);
        connector.Open();


        connector.MoveFinger(31, 90);
        StartCoroutine(ArduinoEvent());
    }
    public bool pushing = false;                //This is handle for pushing received by arduino > send to 'Bird.cs'

    void Awake()
    {
        //If we don't currently have a game control...
        if (instance == null)
        {
            //...set this one to be it...
            instance = this;
            connect.Open();
        }
        //...otherwise...
        else if (instance != this)
        {
            //...destroy this one because it is a duplicate.
            Destroy(gameObject);
            connect.Close();
        }
    }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     serial.Open();
 }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     a = gameObject.AddComponent <ArduinoConnector>();
     a.Open();
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     arduinoConnector = GetComponent <ArduinoConnector>();   //to access properties of ArduinoConnector script
     arduinoConnector.Open();                                //open serial connection
     arduinoConnector.ReadByteFromArduinoAsync(arduinoRead); //read from Arduino
 }
Ejemplo n.º 7
0
 void Awake()
 {
     ard.Open();
 }