public void UpdatePin(int pin, int value)
 {
     if (!_connected)
     {
         return;
     }
     value = (int)Mathf.Clamp(value, 0, 255);
     _firmata.pinMode(pin, 3);
     _firmata.analogWrite(pin, value);
     //Debug.Log("analogWrite pin " + pin + " value " + value);
 }
示例#2
0
    public void UpdatePin(int pin, float normalizedForce)
    {
        if (!_connected)
        {
            return;
        }
        int intValue = (int)Mathf.Lerp(minValue, maxValue, normalizedForce);

        _firmata.pinMode(pin, 3);
        _firmata.analogWrite(pin, intValue);
    }