compiling error

How to correct the error

// Set things up
#include <Goertzel.h>
int sensorPin =PA6;
//int sensorPin =A0;
int led = PC13;
//int led = 13;
//const float TARGET_FREQUENCY = 500;
const float TARGET_FREQUENCY = 5000;
const int N = 100;
const float THRESHOLD = 4000;
const float SAMPLING_FREQUENCY = 8900;
// Create the filter
//Goertzel goertzel = Goertzel(TARGET_FREQUENCY, N, SAMPLING_FREQUENCY); 
Goertzel goertzel = Goertzel(TARGET_FREQUENCY, N, SAMPLING_FREQUENCY);
void setup(){
  pinMode(led, OUTPUT);    
void loop()
// Check samples for tone at target
   float magnitude = goertzel.detect();
// if the tone is present, light LED
     digitalWrite(led, HIGH);
     digitalWrite(led, LOW);
     // Serial.println(magnitude);

The error
Arduino: 1.9.0-beta (Windows 7), Board: “Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)”

In file included from C:\Users\John\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2017.8.5\cores\maple/WString.h:28:0,

from C:\Users\John\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2017.8.5\cores\maple/wirish.h:47,

from C:\Users\John\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2017.8.5\cores\maple/Arduino.h:30,

from C:\Users\John\Documents\Arduino\libraries\Goertzel-master\Goertzel.cpp:19:

C:\Users\John\Documents\Arduino\libraries\Goertzel-master\Goertzel.cpp:26:5: error: expected unqualified-id before numeric constant

int _N;


C:\Users\John\Documents\Arduino\libraries\Goertzel-master\Goertzel.cpp: In constructor ‘Goertzel::Goertzel(float, float, float)’:

C:\Users\John\Documents\Arduino\libraries\Goertzel-master\Goertzel.cpp:48:8: error: lvalue required as left operand of assignment



C:\Users\John\Documents\Arduino\libraries\Goertzel-master\Goertzel.cpp:50:7: error: lvalue required as left operand of assignment



exit status 1
Error compiling for board Generic STM32F103C series.

Is this the library?

Try re-installing it.

Reinstalled = no changes in error

Looks to me like there is a "#define _N (some integer constant)" in the code, probably in Arduino.h or one of the many files it includes. The easiest fix might be to edit the Goertzel library to change _N to another name, like '_Num'.

If it fixes the problem, you should submit a pull request to the library.

I checked for ; N in Arduino.h and Goertzel.h, there is no one.

  The Goertzel algorithm is long standing so see for a full description.
  It is often used in DTMF tone detection as an alternative to the Fast 
  Fourier Transform because it is quick with low overheard because it
  is only searching for a single frequency rather than showing the 
  occurrence of all frequencies.
  This work is entirely based on the Kevin Banks code found at 
  so full credit to him for his generic implementation and breakdown. I've
  simply massaged it into an Arduino library. I recommend reading his article
  for a full description of whats going on behind the scenes.

  See and add yourself for pull requests
  Released into the public domain.

// ensure this library description is only included once
#ifndef Goertzel_h
#define Goertzel_h

// include types & constants of Wiring core API
#include "Arduino.h"

#define MAXN 200
#define ADCCENTER 512

// library interface description
class Goertzel
  // user-accessible "public" interface
	void sample(int);
	float detect();

  // library-accessible "private" interface
	void GetRealImag(float*,float*);
	void ProcessSample(int);
	void ResetGoertzel(void);

 Arduino.h - Main include file for the Arduino SDK
 Copyright (c) 2005-2013 Arduino Team.  All right reserved.

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#ifndef Arduino_h
#define Arduino_h

#ifdef __cplusplus
extern "C" {

#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

#include "stdlib_noniso.h"
#include "binary.h"
#include "esp8266_peri.h"
#include "twi.h"

#include "core_esp8266_features.h"
#include "core_esp8266_version.h"

#define HIGH 0x1
#define LOW  0x0

#define INPUT             0x00
#define INPUT_PULLUP      0x02
#define INPUT_PULLDOWN_16 0x04 // PULLDOWN only possible for pin16
#define OUTPUT            0x01
#define OUTPUT_OPEN_DRAIN 0x03
#define WAKEUP_PULLUP     0x05
#define WAKEUP_PULLDOWN   0x07
#define SPECIAL           0xF8 //defaults to the usable BUSes uart0rx/tx uart1tx and hspi
#define FUNCTION_0        0x08
#define FUNCTION_1        0x18
#define FUNCTION_2        0x28
#define FUNCTION_3        0x38
#define FUNCTION_4        0x48

#define PI 3.1415926535897932384626433832795
#define HALF_PI 1.5707963267948966192313216916398
#define TWO_PI 6.283185307179586476925286766559
#define DEG_TO_RAD 0.017453292519943295769236907684886
#define RAD_TO_DEG 57.295779513082320876798154814105
#define EULER 2.718281828459045235360287471352

#define SERIAL  0x0
#define DISPLAY 0x1

#define LSBFIRST 0
#define MSBFIRST 1

//Interrupt Modes
#define RISING    0x01
#define FALLING   0x02
#define CHANGE    0x03
#define ONLOW     0x04
#define ONHIGH    0x05
#define ONLOW_WE  0x0C
#define ONHIGH_WE 0x0D

#define DEFAULT 1
#define EXTERNAL 0

//timer dividers
  TIM_DIV1 = 0,   //80MHz (80 ticks/us - 104857.588 us max)
  TIM_DIV16 = 1,  //5MHz (5 ticks/us - 1677721.4 us max)
  TIM_DIV256 = 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max)

//timer int_types
#define TIM_EDGE	0
#define TIM_LEVEL	1
//timer reload values
#define TIM_SINGLE	0 //on interrupt routine you need to write a new value to start the timer again
#define TIM_LOOP	1 //on interrupt the counter will start with the same value again

#define timer1_read()           (T1V)
#define timer1_enabled()        ((T1C & (1 << TCTE)) != 0)
#define timer1_interrupted()    ((T1C & (1 << TCIS)) != 0)

typedef void(*timercallback)(void);

void timer1_isr_init(void);
void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload);
void timer1_disable(void);
void timer1_attachInterrupt(timercallback userFunc);
void timer1_detachInterrupt(void);
void timer1_write(uint32_t ticks); //maximum ticks 8388607

// timer0 is a special CPU timer that has very high resolution but with
// limited control.
// it uses CCOUNT (ESP.GetCycleCount()) as the non-resetable timer counter

I find N in Goertzel.cpp, but can't modify it.

I find N in Goertzel.cpp, but can’t modify it.

Open the file with a text editor. Edit and save.

Notepad++ is a good editor for code files but any basic editor will do.

Thanks it is done, no errors