Instance Methodmadmachineio.swiftio 0.1.0SwiftIO
suspend
Suspends the PWM output.
func suspend()
Suspends the PWM output.
func suspend()
import SwiftIO
The SwiftIO library allows you to access and control the hardware in an easy way.
final class PWMOut
The PWMOut class is used to generate periodic square waves and modulate the pulse width to get different average output.
func set(frequency: Int, dutycycle: Float)
Sets the frequency and the dutycycle of PWM output signal.
func set(period: Int, pulse: Int)
Sets the period and pulse width of PWM output signal.
func setDutycycle(_ dutycycle: Float)
Sets the percentage of time during a period in which the output is high, from 0.0 to 1.0
func resume()
Continues the PWM output.
init(_ idName: Id, frequency: Int = 1000, dutycycle: Float = 0.0)
Initializes a PWM output with the specified frequency and dutycycle.
var maxFrequency: Int { get }
The max frequency of PWM output.
var minFrequency: Int { get }
The min frequency of PWM output.
let obj: UnsafeMutableRawPointer