Add ESP32 PWMOutput support

This commit is contained in:
Piv
2020-09-09 20:46:04 +09:30
parent 08e97f38de
commit 970aac9025
3 changed files with 88 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ open class PWMHardwareServo : Servo{
self.device = pin
self.device.initPWM()
self.internalValue = initialValue
self.device.startPWM(period: Int(self.frameWidth), duty: self.minDc + self.dcRange * ((internalValue - self.minValue) / self.valueRange) * 100)
self.value = initialValue
}
public func min(){