C# Class CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent

A buzzer device abstraction component.
Inheritance: ComponentBase, IBuzzer
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Buzz ( UInt32 freq ) : void

Start the buzzer at the specified frequency.

Buzz ( UInt32 freq, Int32 duration ) : void

Start the buzzer at the specified frequency for the specified duration.

BuzzerComponent ( IGpio pwmPin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent class with the pin the buzzer is attached to.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent was occupying.

Stop ( ) : void

Stops the buzzer.

Method Details

Buzz() public method

Start the buzzer at the specified frequency.
public Buzz ( UInt32 freq ) : void
freq System.UInt32 /// The frequency to buzz at. ///
return void

Buzz() public method

Start the buzzer at the specified frequency for the specified duration.
public Buzz ( UInt32 freq, Int32 duration ) : void
freq System.UInt32 /// The frequency to buzz at. ///
duration System.Int32 /// The duration in milliseconds. ///
return void

BuzzerComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent class with the pin the buzzer is attached to.
/// The pin cannot be null. ///
public BuzzerComponent ( IGpio pwmPin ) : System
pwmPin IGpio /// The pin the buzzer is attached to. ///
return System

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Buzzer.BuzzerComponent was occupying.
public Dispose ( ) : void
return void

Stop() public method

Stops the buzzer.
public Stop ( ) : void
return void