I have invested the better part of the entire Christmas weekend trying to debug this. So far the books I have read have been next to useless as the authors chose not to start with an entire class library code that did anything meaningful and walk through each aspect of the development. I worked around one compile problem, an enumeration defined in a header by redefining it as constants. Now I have a whole new gaggle of compiler complaints that were not visible before, presumably because the compiler quit after hitting the enumeration.
The project UIControl.ino is a test container intended to test the interfaces on class ExternPWM.cpp. ExternalPWM.cpp is the class library and ExternalPWM.h is its header file, and cmos.h is the enumeration. Below is the schematic of the circuit to be controlled. The increment and decrement pins induce additional clock cycles for a given counter chain thus altering the relative phasing at the output XNOR gate. The result is a continuous wave PWM that retains dutycycle and does not require process time when duty cycle is not being changed. The circuitry works as I have used the blink code to run a continuous advance on one counter resulting in a linear symmetrical PWM ramp.
Most of my errors were lack of type declaration in the cpp on functions although already declared or so I thought withing the class definition in the header. The revised cpp is on this post.
This version compiles with only 1 warning.
"C:\arduino-1.0\hardware\arduino\cores\arduino\Tone.cpp:108: warning: only initialized variables can be placed into program memory area"
Nope, I intalled fresh copy of the IDE. The only code changed is the code I have written. I added ShiftPhase to the priv section now mIOP1 and mIOP2 are using the class defined variables.
I don't know. Is it supposed to be a class member?
and add the class binding?
Not sure what you mean by this. If you are referring to the scope resolution operator (the class name followed by ::), then, yes, if ShiftPhase() is supposed to be a class member.