Overview: Before working with System Services, instantiate a SystemServiceClient in the base class, add it to the .AddClients(x,x,x) parameters, and pass it to any classes/methods that may need it. Syntax examples are based on an instantiated SystemServiceClient object named "mySystemServiceClient". This information is an explanation of C# hardware analog and digital IO calls on the OpenPV S50 & S70. It is only intended to provide examples of the syntax used to access IO ports on OpenPV targets. |
SetBuzzerConfig :
The SetBuzzerConfig method is a function of the SystemServiceClient and requires a BuzzerConfig object which has three fields: IsEnabled (bool), VolumePct (int), FrequencyInHz (int)
To call SetBuzzerConfig without a previously instantiated BuzzerConfig, a new BuzzerConfig object can be created and initialized within the argument:
mySystemServiceClient.SetBuzzerConfig(new BuzzerConfig() { IsEnabled = true, VolumePct = 100, FrequencyInHz = 1000};
BuzzerConfig:
An example of instantiating and initializing a BuzzerConfig object (myBuzzerConfig), assigning different values to each of its fields, and using myBuzzerConfig as the argument to set the buzzer is:
BuzzerConfig myBuzzerConfig = new BuzzerConfig() { IsEnabled = false, VolumePct = 0, FrequencyInHz = 500 };
myBuzzerConfig.IsEnabled = true;
myBuzzerConfig.VolumePct = 100;
myBuzzerConfig.FrequencyInHz = 1000;
mySystemServiceClient.SetBuzzerConfig(myBuzzerConfig);
Comments
0 comments
Please sign in to leave a comment.