2014-12-15 16:21:06 -05:00
|
|
|
/*
|
|
|
|
* Author: Jon Trulson <jtrulson@ics.com>
|
|
|
|
* Copyright (c) 2014 Intel Corporation.
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* This program and the accompanying materials are made available under the
|
|
|
|
* terms of the The MIT License which is available at
|
|
|
|
* https://opensource.org/licenses/MIT.
|
2014-12-15 16:21:06 -05:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2014-12-15 16:21:06 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <iostream>
|
2017-08-30 15:00:29 -07:00
|
|
|
|
2016-09-13 16:09:09 -07:00
|
|
|
#include "speaker.hpp"
|
2014-12-15 16:21:06 -05:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
int
|
|
|
|
main()
|
2014-12-15 16:21:06 -05:00
|
|
|
{
|
2017-08-30 15:00:29 -07:00
|
|
|
//! [Interesting]
|
|
|
|
// Instantiate a Speaker on digital pin D2
|
|
|
|
upm::Speaker speaker(2);
|
2014-12-15 16:21:06 -05:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
// Play all 7 of the lowest notes
|
|
|
|
speaker.playAll();
|
2014-12-15 16:21:06 -05:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
// Play a medium C-sharp
|
|
|
|
speaker.playSound('c', true, "med");
|
|
|
|
//! [Interesting]
|
2014-12-15 16:21:06 -05:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
cout << "Exiting" << endl;
|
2014-12-15 16:21:06 -05:00
|
|
|
|
2017-08-30 15:00:29 -07:00
|
|
|
return 0;
|
2014-12-15 16:21:06 -05:00
|
|
|
}
|