Share via


PWM Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a PWM port.

Inheritance Hierarchy

System. . :: . .Object
  Microsoft.SPOT.Hardware..::..PWM

Namespace:  Microsoft.SPOT.Hardware
Assembly:  Microsoft.SPOT.Hardware.PWM (in Microsoft.SPOT.Hardware.PWM.dll)

Syntax

'Declaration
Public Class PWM _
    Implements IDisposable
public class PWM : IDisposable
public ref class PWM : IDisposable
type PWM =  
    class
        interface IDisposable
    end
public class PWM implements IDisposable

The PWM type exposes the following members.

Constructors

  Name Description
Public method PWM(Cpu. . :: . .PWMChannel, Double, Double, Boolean) Initializes a new instance of the PWM class with the specified channel, frequency, duty cycle, and value that indicates whether the output is inverted.
Public method PWM(Cpu. . :: . .PWMChannel, UInt32, UInt32, PWM. . :: . .ScaleFactor, Boolean) Initializes a new instance of the PWM class with the specified channel, period, duration, scale and value that indicates whether the output is inverted.

Top

Properties

  Name Description
Public property Duration Gets or sets the duration of the pulse. Value should be a fraction of the period.
Public property DutyCycle Gets or sets the duty cycle of the pulse as a fraction of unity.
Public property Frequency Gets or sets the frequency of the pulse.
Public property Period Gets or sets the period of the pulse.
Public property Pin Gets the GPIO pin for the channel.
Public property Scale Gets or sets the scale factor for the duration and period.

Top

Methods

  Name Description
Protected method Commit Moves values to the HAL.
Public method Dispose() () () () Releases resources, including stopping the port if still running and releasing the underlying pin.
Protected method Dispose(Boolean) Releases resources, including stopping the port if still running and releasing the underlying pin, and optionally releases unmanaged resources.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Stops the port, if running, and releases the resources before being reclaimed by the garbage collector. (Overrides Object. . :: . .Finalize() () () ().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Init Initializes the controller.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Start() () () () Starts the PWM port for an indefinite amount of time.
Public methodStatic member Start(array<PWM> [] () [] []) Starts a number of PWM ports at the same time.
Public method Stop() () () () Stops the PWM port.
Public methodStatic member Stop(array<PWM> [] () [] []) Stops a number of PWM ports at the same time.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Protected method Uninit Uninitializes the controller.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SPOT.Hardware Namespace