sensorium / Mozzi

sound synthesis library for Arduino
https://sensorium.github.io/Mozzi/
GNU Lesser General Public License v2.1
1.07k stars 186 forks source link

initializeCPUCycles and FAST error #23

Open jeffThompson opened 8 years ago

jeffThompson commented 8 years ago

Wonderful project, thank you so much! I get an error trying to compile my sketch, which I believe is from the Mozzi library:

Users/JeffThompson/Documents/Arduino/libraries/Mozzi/MozziGuts.cpp: In function 'void startAudioStandard()':
/Users/JeffThompson/Documents/Arduino/libraries/Mozzi/MozziGuts.cpp:285:9: error: 'class TimerOne' has no member named 'initializeCPUCycles'
  Timer1.initializeCPUCycles(16000000UL/PWM_RATE, FAST); // fast mode enables higher PWM rate
         ^
/Users/JeffThompson/Documents/Arduino/libraries/Mozzi/MozziGuts.cpp:285:50: error: 'FAST' was not declared in this scope
  Timer1.initializeCPUCycles(16000000UL/PWM_RATE, FAST); // fast mode enables higher PWM rate
                                                  ^
exit status 1
Error compiling.

Is this an issue with the library?

sensorium commented 8 years ago

Hi Jeff, what version of Arduino are you using to compile?

Tim

On 26 January 2016 at 02:32, Jeff Thompson notifications@github.com wrote:

Wonderful project, thank you so much! I get an error trying to compile my sketch, which I believe is from the Mozzi library:

Users/JeffThompson/Documents/Arduino/libraries/Mozzi/MozziGuts.cpp: In function 'void startAudioStandard()': /Users/JeffThompson/Documents/Arduino/libraries/Mozzi/MozziGuts.cpp:285:9: error: 'class TimerOne' has no member named 'initializeCPUCycles' Timer1.initializeCPUCycles(16000000UL/PWM_RATE, FAST); // fast mode enables higher PWM rate ^ /Users/JeffThompson/Documents/Arduino/libraries/Mozzi/MozziGuts.cpp:285:50: error: 'FAST' was not declared in this scope Timer1.initializeCPUCycles(16000000UL/PWM_RATE, FAST); // fast mode enables higher PWM rate ^ exit status 1 Error compiling.

Is this an issue with the library?

— Reply to this email directly or view it on GitHub https://github.com/sensorium/Mozzi/issues/23.

jeffThompson commented 8 years ago

Should have mentioned that! I'm running 1.6.6. Tried compiling for several different boards to see if that was the issue, but they all gave the same error.

tfry-git commented 6 years ago

This is almost certainly caused by the compiler picking up the TimerOne.h header from a separately installed library rather than Mozzi's version.

Not sure on the best way out of this. TimerOne.cpp already has #include with quotation marks instead of angle brackets, so that won't help. @jeffThompson are you still around? If so, could you try editing Mozzi\utility\TimerOne.cpp, replacing #include "TimerOne.h" with #include "../utility/TimerOne.h"?