Cornell University ECE 3140 - Lab 6
/
Lab6-FinalProject
Repository for ECE 3140 Final Project
Diff: main.cpp
- Revision:
- 96:93d556043569
- Parent:
- 95:f191a7ee705b
--- 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); } }