Exemple #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
    }
Exemple #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();
        }
    }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     serial.Open();
 }
 // Use this for initialization
 void Start()
 {
     a = gameObject.AddComponent <ArduinoConnector>();
     a.Open();
 }
Exemple #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
 }
Exemple #7
0
 void Awake()
 {
     ard.Open();
 }