Ciao a tutti, sto provando a ottenere la frequenza dei battiti cardiaci tramite un arduino nano esp32 e un sensore pulsesensor (quindi utilizzando la libreria “PulseSensorPlayground”).
Nel momento in cui svolgo l’invio del codice alla scheda (codice proveniente dall’esempio della libreria) mi appare questo errore:
C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp: In member function 'bool PulseSensorPlayground::setupInterrupt()':
C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:493:37: error: too few arguments to function 'hw_timer_t* timerBegin(uint8_t, uint16_t, bool)'
sampleTimer = timerBegin(1000000); // 1MHz ticker, 1uS tick period
^
In file included from C:\Users\PC\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/esp32-hal.h:92,
from C:\Users\PC\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/Arduino.h:36,
from C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src/PulseSensorPlayground.h:21,
from C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:17:
C:\Users\PC\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/esp32-hal-timer.h:33:14: note: declared here
hw_timer_t * timerBegin(uint8_t timer, uint16_t divider, bool countUp);
^~~~~~~~~~
C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:494:51: error: too few arguments to function 'void timerAttachInterrupt(hw_timer_t*, void (*)(), bool)'
timerAttachInterrupt(sampleTimer, &onInterrupt);
^
In file included from C:\Users\PC\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/esp32-hal.h:92,
from C:\Users\PC\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/Arduino.h:36,
from C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src/PulseSensorPlayground.h:21,
from C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:17:
C:\Users\PC\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.18-arduino.5\cores\esp32/esp32-hal-timer.h:40:6: note: declared here
void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge);
^~~~~~~~~~~~~~~~~~~~
C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:495:5: error: 'timerAlarm' was not declared in this scope
timerAlarm(sampleTimer, 2000, true, 0);
^~~~~~~~~~
C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground\src\PulseSensorPlayground.cpp:495:5: note: suggested alternative: 'timerStart'
timerAlarm(sampleTimer, 2000, true, 0);
^~~~~~~~~~
timerStart
Uso la libreria PulseSensor Playground alla versione 2.4.0 nella cartella: C:\Users\PC\Documents\Arduino\libraries\PulseSensor_Playground
exit status 1
Compilation error: exit status 1
Potreste aiutarmi a capire cortesemente?
Grazie in anticipo
