public PWM( I2C i2c, int num ) { _i2c = i2c; this.ServoMin = 200; // default this.ServoMax = 500; this.ServoPluse = (ServoMin + ServoMax) / 2; this.ServoNum = num; // Servo No. }
private void MainPage_Loaded(object sender, RoutedEventArgs e) { _i2c = new I2C(); _i2c.Initialize(); this.servo0 = _i2c.CreatePWM(0, 200, 500); this.servo1 = _i2c.CreatePWM(1, 200, 500); this.servo2 = _i2c.CreatePWM(2, 200, 500); this.servo3 = _i2c.CreatePWM(3, 200, 500); }