Table of Contents

Class Buzzer

Namespace
Iot.Device.Buzzer
Assembly
Iot.Device.Buzzer.dll

Simple buzzer.

[Interface("Simple buzzer")]
public class Buzzer
Inheritance
Buzzer

Constructors

Buzzer(PwmChannel)

Initializes a new instance of the Buzzer class.

public Buzzer(PwmChannel pwmChannel)

Parameters

pwmChannel PwmChannel

The PWM controller to use during work.

Buzzer(int)

Initializes a new instance of the Buzzer class.

public Buzzer(int pinNumber)

Parameters

pinNumber int

Pin connected to buzzer.

Buzzer(int, int)

Initializes a new instance of the Buzzer class.

public Buzzer(int chip, int channel)

Parameters

chip int

The GPIO pin number in case of a software PWM. The chip in case of a hardware PWM.

channel int

The channel to use in case of a hardware PWM.

Methods

Dispose()

Dispose Buzzer.

public void Dispose()

PlayTone(double, int)

Play tone of specific frequency for specified duration.

[Command]
public void PlayTone(double frequency, int duration)

Parameters

frequency double

Tone frequency in Hertz.

duration int

Playing duration in millisecons.

StartPlaying(double)

Set new or overwrite previously set frequency and start playing the sound.

[Command]
public void StartPlaying(double frequency)

Parameters

frequency double

Tone frequency in Hertz.

StopPlaying()

Stop playing tone.

[Command]
public void StopPlaying()