WorldFamousElectronics / PulseSensorPlayground

A PulseSensor library (for Arduino) that collects our most popular projects in one place.
https://PulseSensor.com
MIT License
200 stars 97 forks source link

PulseSensorPlayground does not work on Arduino Uno WiFi Rev2 #83

Closed Tommaarleveld closed 5 years ago

Tommaarleveld commented 5 years ago

Im trying to get a simple BPM reading using the Arduino Uno WiFi Rev2. When compiling I seem to be getting an error. I just need a serial reading. Is there a simple fix for this issue? Or do I need another Arduino board?

This is my error:

Arduino: 1.8.9 (Mac OS X), Board: "Arduino Uno WiFi Rev2, ATMEGA328"

In file included from /Users/tommaarleveld/Library/Arduino15/packages/arduino/hardware/megaavr/1.6.25/cores/arduino/Arduino.h:27:0,
                 from sketch/Getting_BPM_to_Monitor.ino.cpp:1:
/Users/tommaarleveld/Documents/Arduino/libraries/PulseSensor_Playground/src/utility/Interrupts.h: In function 'void TIMER1_COMPA_vect()':
/Users/tommaarleveld/Documents/Arduino/libraries/PulseSensor_Playground/src/utility/Interrupts.h:207:9: warning: 'TIMER1_COMPA_vect' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
     ISR(TIMER1_COMPA_vect)
         ^
/Users/tommaarleveld/Documents/Arduino/libraries/PulseSensor_Playground/src/utility/PulseSensor.cpp: In member function 'void PulseSensor::updateLEDs()':
/Users/tommaarleveld/Documents/Arduino/libraries/PulseSensor_Playground/src/utility/PulseSensor.cpp:221:33: error: cannot convert 'volatile boolean {aka volatile bool}' to 'PinStatus' for argument '2' to 'void digitalWrite(pin_size_t, PinStatus)'
     digitalWrite(BlinkPin, Pulse);
                                 ^
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.
preksha02 commented 5 years ago

I am also using arduino UNO and its working perfectly.

biomurph commented 5 years ago

@Tommaarleveld It looks like the Arduino Uno WiFi Rev2 uses the ATmega 4809. Previous versions used the ATmega 328. I may have to adjust the Library to handle this issue with the interrupt function. The issue with the Pulse variable has already been fixed.

I have just successfully compiled the latest library version against the Arduino Uno WiFi Rev2 and I am not getting this error. I pulled the PulseSensor_BPM example sketch and it seems to pass the compiler test. I don't have an Arduino Uno WiFi Rev2 on hand, but will get one soon to check that this will work. Please try again.