void Update()
 {
     if (arduino.Ready())
     {
         if (baselined)
         {
             for (int i = 0; i < 3; i++)
             {
                 tilt[i] = arduino.GetAnalogInput(inputPins[i]) - baseline[i];
             }
             //Debug.Log("X: " + tilt[0] + " Y: " + tilt[1] + " Z: " + tilt[2]);
         }
     }
 }
Esempio n. 2
0
 void Update()
 {
     if (arduino.Ready())
     {
         if (baselined)
         {
             for (int i = 0; i < 3; i++)
             {
                 volume = arduino.GetAnalogInput(inputPin) - baseline;
             }
             Debug.Log("Volume" + volume);
         }
     }
 }
    void Update()
    {
        // Check for Arduino input. Don't continue if Arduino is not ready.
        if (!arduino.Ready())
        {
            return;
        }

        // Basic analog and digital input
        Debug.Log("Analog: " + arduino.GetAnalogInput(0) + " Digital: " + arduino.GetDigitalInput(0));

        // Button-like digital input
        if (arduino.GetButtonDown(0))
        {
            Debug.Log("Digital pressed");
        }
    }