I have a servo connected to the A7 pin on my photon. I mistakenly looked at the outputs for the Spark prior to building my PCB (Spark has hardware PWM support on pin A7, but the Photon does not).
My mistake aside, software PWM is useful tool in our collective Photon chest.
I attempted to use the Arduino SoftwareServo code (http://playground.arduino.cc/ComponentLib/Servo) on my Photon. I feel it would be a useful addition to Photon users, but I am struggling to get it to work.
First I included Softwareservo.h and SoftwareServo.cpp.
I replaced “#include <WProgram.h>” with “#include<applcation.h>”, which got past the first compile error.
Now it is giving me the following two compile errors and I am completely stuck:
SoftwareServo.cpp:51:51: error: 'clockCyclesPerMicrosecond' was not declared in this scope pulse0 = (min16*16L*clockCyclesPerMicrosecond() + (max16-min16)*(16L*clockCyclesPerMicrosecond())*angle/180L)/64L;
SoftwareServo.cpp:108:21: error: 'TCNT0' was not declared in this scope uint8_t start = TCNT0;
Any help getting this working or, or a pointer to a working Software PWM library would be greatly appreciated.