Add string based constructor for Buzzer and an example to initialize it

This commit is contained in:
mihais
2018-03-29 18:03:59 +03:00
committed by Stefan Andritoiu
parent a1accb65df
commit 145db5997b
6 changed files with 65 additions and 78 deletions

View File

@ -7,6 +7,6 @@
int
main(int argc, char** argv)
{
upm::Buzzer buzzer("p:33,vol:1.0");
upm::Buzzer buzzer("p:32,vol:0.01,play:3800:500000");
return 0;
}

View File

@ -35,7 +35,7 @@ main(int argc, char** argv)
int chord[] = { BUZZER_DO, BUZZER_RE, BUZZER_MI, BUZZER_FA, BUZZER_SOL, BUZZER_LA, BUZZER_SI };
// create Buzzer instance
upm::Buzzer sound(5);
upm::Buzzer sound(32);
// print sensor name
std::cout << sound.name() << std::endl;