Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 96:93d556043569, committed 2019-05-12
- Comitter:
- TSSherman98
- Date:
- Sun May 12 04:09:15 2019 +0000
- Parent:
- 95:f191a7ee705b
- Commit message:
- Commit as of 05/12/2019 at 12:09 AM
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun May 12 03:35:54 2019 +0000 +++ b/main.cpp Sun May 12 04:09:15 2019 +0000 @@ -1,4 +1,4 @@ -/* +/* ECE 3140 - Spring 2019 Lab #6 - Final Project 04//25/2019 - 05/17/2019 @@ -10,8 +10,6 @@ GLOBAL VARIABLES *----------------------------------------------------------------------------*/ const double pi = 3.141592653589793238462; -const double amplitude = 0.5f; -const double offset = 65535/2; double offset = 65535/2; double amplitude = 65535/2; //this controls VOLUME double freq = 2000.0; //frequency in Hz --> controls TONE @@ -29,9 +27,9 @@ clock.start(); //counts time in microseconds uint16_t sample; //voltage to be output led1 = !led1; //turn on LED to indicate operation - + while (1) { - sample = (uint16_t)((amplitude)*sin(2.0*pi*f*clock.read_us())+offset); + sample = (uint16_t)((amplitude)*sin(2.0*pi*f*clock.read_us())+offset); aout.write_u16(sample); } }