To make our tone change we changed the amplitude to 0.5. We also made our delay 0.5. This made our tone repeat itself rapidly and the amplitude changed the sound.
float sinVal;
int toneVal;
int k=0;
void setup () {
pinMode(8,OUTPUT);
}
void loop () {
while (k< 2000){
for (int x=0;x<180;x++) {
// convert degrees to radians then obtain sin value
sinVal = (sin(x*(3.1412/180)));
// generate a frequency from the sin value
toneVal = 2000+(int(sinVal*1000));
tone(8, toneVal);
k++;
delay(2);
}}
for (int x=0;x<180;x++) {
// convert degrees to radians then obtain sin value
sinVal = (sin(x*(3.1412/180)));
// generate a frequency from the sin value
toneVal = 2000+(int(sinVal*1000));
tone(8, toneVal);
delay(5);}
}
URL for the video: https://drive.google.com/a/slsharks.net/file/d/0B6Ep8JcC1gm_dXZYR0dSUDVPVEk/view
float sinVal;
int toneVal;
int k=0;
void setup () {
pinMode(8,OUTPUT);
}
void loop () {
while (k< 2000){
for (int x=0;x<180;x++) {
// convert degrees to radians then obtain sin value
sinVal = (sin(x*(3.1412/180)));
// generate a frequency from the sin value
toneVal = 2000+(int(sinVal*1000));
tone(8, toneVal);
k++;
delay(2);
}}
for (int x=0;x<180;x++) {
// convert degrees to radians then obtain sin value
sinVal = (sin(x*(3.1412/180)));
// generate a frequency from the sin value
toneVal = 2000+(int(sinVal*1000));
tone(8, toneVal);
delay(5);}
}
URL for the video: https://drive.google.com/a/slsharks.net/file/d/0B6Ep8JcC1gm_dXZYR0dSUDVPVEk/view