Hi,
I just upgraded from Arduino 1.6.8 to 1.8.8 after not using it for like 2 years. I tried to compile a sketch that is using a downloaded library (PalatisSoftPWM) and it fails with the error message:
error: expected unqualified-id before ')' token
That library is installed in my sketch folder, and the IDE seems to recognize it (it's listed in the libraries menu). The sketch worked before, I didn't change any code. So i tried to compile a sample sketch that is delivered with the library and it breaks with the same error. After that I re-installed 1.6.8 - and it compiled again, the sample sketch and my own sketch using the library.
Sketches that use other libraries are compiling fine (with 1.6.8 and 1.8.8 ), but I can't get this specific library to work. I re-downloaded it and replaced the old copy in my sketchbook libraries folder, but still no luck.
The code of the example sketch is as follows:
/* Demonstrates usage of the PalatisSoftPWM library.
Fades Arduino pin 13 from PWM value 0 to the highest level and back to 0 again.
*/
#include <PalatisSoftPWM.h>
SOFTPWM_DEFINE_PIN13_CHANNEL(0); //Configure Arduino pin 13 as PWM channel 0
SOFTPWM_DEFINE_OBJECT(1);
const unsigned int fadeDuration = 1000; // (ms)The length of time for to go from PWM value 0 to the highest level and back to 0 again. The maximum allowed value is 8388.
void setup() {
PalatisSoftPWM.begin(60); // begin with 60 Hz PWM frequency
}
void loop() {
// fade from PWM value 0 to the highest value
for (byte value = 0; value < PalatisSoftPWM.PWMlevels() - 1; value++) {
delayMicroseconds(fadeDuration * 1000UL / PalatisSoftPWM.PWMlevels() / 2);
PalatisSoftPWM.set(0, value);
}
// fade back to PWM value 0
for (int value = PalatisSoftPWM.PWMlevels() - 1; value >= 0; value--) {
delayMicroseconds(fadeDuration * 1000UL / PalatisSoftPWM.PWMlevels() / 2);
PalatisSoftPWM.set(0, value);
}
}
Exact error message when compiling this sketch:
PalatisSoftPWM_example:7:1: error: expected unqualified-id before ')' token
SOFTPWM_DEFINE_PIN13_CHANNEL(0); //Configure Arduino pin 13 as PWM channel 0
^
exit status 1
expected unqualified-id before ')' token
I can reproduce this by switching between 1.6.8 and 1.8.8 - everytime I try to compile with 1.6.8 it compiles correctly, and it never does with 1.8.8.
What am I missing here? What did I forget while not using Arduino for 2 years?
Thanks for any help!