This commit is contained in:
2022-01-28 16:01:07 -06:00
parent 8dc484e0d1
commit f409bfa319
4 changed files with 309 additions and 201 deletions

View File

@@ -46,10 +46,10 @@ void play_note(Note noteToPlay) {
*TIM3_PSC = 15;
//Divisor controls pitch
*TIM3_ARR = mil/(noteToPlay.noteFrequency);
*TIM3_ARR = (pitchDivisor)/(noteToPlay.noteFrequency/100);
//Loudness (Smaller dividend = louder sound)
double freq = noteToPlay.noteFrequency/10;
double freq = (noteToPlay.noteFrequency/100)/10;
//clear ccr1
*TIM3_CCR1 = (*TIM3_CCR1&~(0xFFFF));