Pulse Sensor AMPED sketch with Arduino yun

i have tried to use the Pulse Sensor AMPED sketch with arduino Yun it give me the following error

Arduino: 1.5.8 (Mac OS X), Board: "Arduino Yún"

Interrupt.ino: In function 'void interruptSetup()': Interrupt.ino:17:3: error: 'TCCR2A' was not declared in this scope Interrupt.ino:18:3: error: 'TCCR2B' was not declared in this scope Interrupt.ino:19:3: error: 'OCR2A' was not declared in this scope Error compiling.

the sketch is working fine with arduino mega and Leonardo. kindly advice how i can edit the sketch to be compatible with arduino yun

i have tried to use the Pulse Sensor AMPED sketch

If you expect us to go hunting the internet for the sketch that maybe you are, or maybe you aren't, using, you'll be waiting a while. The internet is a big place, you know.

PaulS: If you expect us to go hunting the internet for the sketch that maybe you are, or maybe you aren't, using, you'll be waiting a while. The internet is a big place, you know.

Hi, I am pretty new to Yun as well and with the same pulse sensor running into the same problem. Could you kindly explain what we need to do to get rid of this compiling error? What do you mean by looking for sketch on the internet? From hours of searching, seems like lots of people having the same issue, and cant get pass it. No useful /no comments at all. :O

From hours of searching, seems like lots of people having the same issue, and cant get pass it.

And yet you didn't post the offending code, either. Well, good luck resolving it.

Hey there, I was able to find out why the original code doesnt work on Yun (RFardurino)

The solution can be found in this post.
pulsesensor.com/pages/pulse-sensor-amped-arduino-v1dot1

Long story short. the timing rate have to be changed depends on what processor you are using.
The original code works with Arduino UNO or Arduino PRO or Arduino Pro Mini 5V or any Arduino running with an ATmega328 and 16MHz clock.

But The processor inside Yun is ATmega32u4 running at 16MHz
According to the post. For Yun to work you have to swap out some lines in the interrupt.ino code with

void interruptSetup(){

TCCR1A = 0x00;
TCCR1B = 0x0C;
OCR1A = 0x7C;
TIMSK1 = 0x02;

sei();

}

The only other thing you will need is the correct ISR vector in the next step. ATmega32u4 devices use ISR(TIMER1_COMPA_vect)

Hope this will work for people that are having this issue. <3

Sorry PualS, I am pretty new to Arduino. Have you used this pulse sensor before from http://pulsesensor.com/?

Read more: http://pulsesensor.proboards.com/thread/362/compile-code-on-yun?page=1#ixzz3V2OwCBO1