CPX and Meditation Trainer
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CPX and Meditation Trainer

by bcav99 on Sun Mar 18, 2018 1:49 pm

I am interested in the meditation trainer.
Here is the link to the article: https://learn.adafruit.com/heart-rate-v ... r/overview
I have the circuit playground express and the Pulse Sensor AMPED: https://www.adafruit.com/product/1093

I am having trouble compiling the code with the Arduino IDE. I believe the problem is with the definitions of the interrupts. I was just wonder what I needed to do to run this on the circuit playground express.


Posts: 1
Joined: Wed Mar 07, 2018 1:50 pm

Re: CPX and Meditation Trainer

by adafruit_support_mike on Mon Mar 19, 2018 12:10 am

I'm afraid you'll need to rewrite the code.

The folks who make the Pulse Sensor originally wrote their code for the Arduino Uno, which uses an ATmega328 microcontroller. Most of the interrupt behavior transferred across to the Circuit Playground Classic's ATmega32u4, since that belongs to the same family of 8-bit microcontrollers.

The Circuit Playground Express uses a SAMD21 32-bit microcontroller that's completely different internally. Instead of writing code for interrupt routines using the interrupt name, you use the attachInterrupt() function to tell the microcontroller to run a specific function when a specific interrupt is triggered.

https://www.arduino.cc/reference/en/lan ... interrupt/

Posts: 54682
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.