Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PulseSensor Class Reference
Class for interfacing with a http://pulsesensor.myshopify.com/ 'Pulse Sensor Amped'. More...
#include <PulseSensor.h>
Public Member Functions | |
| PulseSensor (PinName analogPin, void(*printDataCallback)(int), int callbackRateMs=20) | |
| PulseSensor Constructor - Note this does not start the reading of the sensor. | |
| ~PulseSensor () | |
| Destructor. | |
| bool | start () |
| Start reading the Pulse Sensor, and sending current readings to the print data callback. | |
| bool | stop () |
| Stops the current reading of the Pulse Senson. | |
Detailed Description
Class for interfacing with a http://pulsesensor.myshopify.com/ 'Pulse Sensor Amped'.
The contents of this class are based on the "Pulse Sensor Amped 1.1" Arduino Sketch.
When using this class for the first time, it is recommended that you use the Processing GUI app available http://pulsesensor.myshopify.com/pages/code-and-guide. Using this, you will easily be able to verify the operating of your sensor, and the integration of this class into your mbed project.
Definition at line 17 of file PulseSensor.h.
Constructor & Destructor Documentation
| PulseSensor | ( | PinName | analogPin, |
| void(*)(int) | printDataCallback, | ||
| int | callbackRateMs = 20 |
||
| ) |
PulseSensor Constructor - Note this does not start the reading of the sensor.
- Parameters:
-
analogPin Name of the analog pin that the sensor is connected to. printDataCallback Pointer to function which will be called to print the latest data. Output format available here: http://pulsesensor.myshopify.com/pages/code-and-guide callbackRateMs Rate at which the printDataCallback is to be called, recommended is 20ms for graphing of pulse signal.
Definition at line 4 of file PulseSensor.cpp.
| ~PulseSensor | ( | ) |
Destructor.
Definition at line 16 of file PulseSensor.cpp.
Member Function Documentation
| bool start | ( | ) |
Start reading the Pulse Sensor, and sending current readings to the print data callback.
- Returns:
- true if reading of the sensor is started, false if reading was aleady in progress.
Definition at line 110 of file PulseSensor.cpp.
| bool stop | ( | ) |
Stops the current reading of the Pulse Senson.
- Returns:
- true if reading is stopped, false if reading was already stopped.
Definition at line 140 of file PulseSensor.cpp.
Generated on Mon Sep 26 2022 15:47:46 by
1.7.2