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.
Diff: Sound/Sound.cpp
- Revision:
- 30:08cc4ec58d07
- Parent:
- 24:c3bb1b0b2207
- Child:
- 31:cfdb014ff086
diff -r 207111ffd6e6 -r 08cc4ec58d07 Sound/Sound.cpp --- a/Sound/Sound.cpp Mon May 25 20:00:31 2020 +0000 +++ b/Sound/Sound.cpp Tue May 26 10:17:47 2020 +0000 @@ -21,7 +21,6 @@ i=0; return(i); } - i=wavetable_itt(i,frequency); if (waveform==1) { @@ -49,9 +48,9 @@ uint16_t Sound::wavetable_itt(uint16_t i, int frequency) { i_d = i + ((1024*frequency)/ 10000); //i+((samples*f)*Ts) - i=ceil(i_d); //ROUND IN FUTURE************* - - if (i>=1024) { + i=ceil(i_d); //rounds to int + + if (i>=1024) { //Sorts Overlap i=i-1024; } return(i);