toneAC v1.2 - Twice the volume, higher quality, higher frequency, etc.

dprovencher:
I run into the same problems I did with toneAC :

/tmp/143048879/build/sketch/toneAC2.cpp:32:3: error: 'OCR2A' was not declared in this scope

/tmp/143048879/build/sketch/toneAC2.cpp:33:7: error: 'TCNT2' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:34:3: error: 'TCCR2B' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:34:17: error: 'WGM22' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:35:3: error: 'TCCR2A' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:35:17: error: 'WGM20' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:35:30: error: 'WGM21' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:36:3: error: 'TIMSK2' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:36:18: error: 'OCIE2A' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:45:3: error: 'TIMSK2' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:45:18: error: 'OCIE2A' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:46:3: error: 'TCCR2B' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:46:17: error: 'CS22' was not declared in this scope
/tmp/143048879/build/sketch/toneAC2.cpp:47:17: error: 'WGM20' was not declared in this scope




I need to change all the registers and constants and I simply don't really know what to look for in the 4809 PDF this is way above my current skill level.

I'm gonna try and play with bitWrite to see if I can get the frequency right. PORTD.OUT first and second bits are the ports I use (A0 et A1).

You really need to use the timers to do this, doesn't work with how your doing it or even using bitwise operations. That's why it's not louder for you..

I would just use an amp instead. That will work for sure as doing it at the microcontroller level won't work if it's changed a bunch.

Or, just get a classic arduino.

Tim