Skip to content

Commit

Permalink
Merge pull request #371 from WildernessLabs/jorge-fix-piezo-sample
Browse files Browse the repository at this point in the history
Update Piezo sample to use TimeSpan
  • Loading branch information
adrianstevens authored Jul 12, 2022
2 parents bdccf98 + e0e4b9e commit 4735593
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public override async Task Run()
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Playing A major triad starting at A4");
await piezoSpeaker.PlayTone(new Frequency(440, Frequency.UnitType.Hertz), 500); //A
await piezoSpeaker.PlayTone(new Frequency(554.37f, Frequency.UnitType.Hertz), 500); //C#
await piezoSpeaker.PlayTone(new Frequency(659.25f, Frequency.UnitType.Hertz), 500); //E
await piezoSpeaker.PlayTone(new Frequency(440, Frequency.UnitType.Hertz), TimeSpan.FromMilliseconds(500)); //A
await piezoSpeaker.PlayTone(new Frequency(554.37f, Frequency.UnitType.Hertz), TimeSpan.FromMilliseconds(500)); //C#
await piezoSpeaker.PlayTone(new Frequency(659.25f, Frequency.UnitType.Hertz), TimeSpan.FromMilliseconds(500)); //E

await Task.Delay(2500);
}
Expand Down

0 comments on commit 4735593

Please sign in to comment.