PulseSensor_Amped_Arduino icon indicating copy to clipboard operation
PulseSensor_Amped_Arduino copied to clipboard

Error while trying to run default code from nodemcu Esp8266

Open dotjavafile opened this issue 8 years ago • 4 comments

Hello I am trying to run the default code provided in the tutorial in nodemcu v1 esp-12e.

github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino

It runs in my arduino uno fine but when I try it with the nodemcu I get following error. Please help.

Read more: http://pulsesensor.proboards.com/thread/474/error-trying-default-code-nodemcu#ixzz4Rbo00iGf

`Interrupt:27: error: expected constructor, destructor, or type conversion before '(' token

ISR(TIMER2_COMPA_vect){ // triggered when Timer2 counts to 124

^

C:\Users\Zero\Documents\Arduino\PulseSensorAmped_Arduino_1dot4\Interrupt.ino: In function 'void interruptSetup()':

Interrupt:17: error: 'TCCR2A' was not declared in this scope

TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC MODE

^

Interrupt:18: error: 'TCCR2B' was not declared in this scope

TCCR2B = 0x06; // DON'T FORCE COMPARE, 256 PRESCALER

^

Interrupt:19: error: 'OCR2A' was not declared in this scope

OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE

^

Interrupt:20: error: 'TIMSK2' was not declared in this scope

TIMSK2 = 0x02; // ENABLE INTERRUPT ON MATCH BETWEEN TIMER2 AND OCR2A

^

C:\Users\Zero\Documents\Arduino\PulseSensorAmped_Arduino_1dot4\Interrupt.ino: At global scope:

Interrupt:27: error: expected constructor, destructor, or type conversion before '(' token

ISR(TIMER2_COMPA_vect){ // triggered when Timer2 counts to 124

^

exit status 1 expected constructor, destructor, or type conversion before '(' token

Read more: http://pulsesensor.proboards.com/thread/474/error-trying-default-code-nodemcu#ixzz4Rbo3ndv4`

dotjavafile avatar Dec 01 '16 17:12 dotjavafile

Please any help?

dotjavafile avatar Dec 02 '16 12:12 dotjavafile

Im also having this problem

LeonFedotov avatar Feb 25 '17 11:02 LeonFedotov

Please any help?

Same error here!

hagelric avatar Feb 04 '18 15:02 hagelric

This is an older repo. We are directing everyone to use our new PulseSensor Playground library https://github.com/WorldFamousElectronics/PulseSensorPlayground

Please follow this tutorial https://pulsesensor.com/pages/getting-advanced Not all hardwares will work with our code that uses interrupts. Please read the entire tutorial and try the example code PulseSensor_BPM_Alternative.ino

Also, note that the ESP8266 ADC can only accept up to 1V max. I'm not sure how the nodemcu works this, but be aware of that.

biomurph avatar Feb 05 '18 15:02 biomurph