dxinteractive / ResponsiveAnalogRead

Arduino library for eliminating noise in analogRead inputs without decreasing responsiveness.
MIT License
293 stars 53 forks source link

Compilation Error in Arduino 1.0.6 with ATmega8 microcontroller #18

Open abdul-rehman-2050 opened 6 years ago

abdul-rehman-2050 commented 6 years ago

Hello! I tried to compile code with arduino 1.0.6 with Atmega8 microcontroller and got following error during compilation.

In file included from pulseWidthCalculator_V01.ino:3: C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:64: error: ISO C++ forbids initialization of member 'analogResolution' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:64: error: making 'analogResolution' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:64: error: ISO C++ forbids in-class initialization of non-const static member 'analogResolution' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:67: error: ISO C++ forbids initialization of member 'activityThreshold' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:67: error: making 'activityThreshold' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:67: error: ISO C++ forbids in-class initialization of non-const static member 'activityThreshold' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:68: error: ISO C++ forbids initialization of member 'edgeSnapEnable' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:68: error: making 'edgeSnapEnable' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:68: error: ISO C++ forbids in-class initialization of non-const static member 'edgeSnapEnable' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:72: error: ISO C++ forbids initialization of member 'errorEMA' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:72: error: making 'errorEMA' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:72: error: ISO C++ forbids in-class initialization of non-const static member 'errorEMA' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:73: error: ISO C++ forbids initialization of member 'sleeping' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:73: error: making 'sleeping' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:73: error: ISO C++ forbids in-class initialization of non-const static member 'sleeping'

edgar-bonet commented 6 years ago

You may try a less ancient version of the Arduino IDE. Alternatively, add the flag -std=c++11 to the options passed to gcc (you will have to dig deep into your IDE's configuration).