upm  0.3.1
Sensor/Actuator repository for libmraa (v0.7.2)
Public Member Functions

UPM module for the AD8232 Heart Rate Monitor. More...

Detailed Description

Note, this sensor must be driven at 3.3v only.

This module will simply spit out the ADC values reported by the sensor, with the intent being to send that data somewhere (via serial or network port) to another piece of software running on a computer that will plot the data for you, like an EKG.

Processing (https://www.processing.org/), is a piece of software that should work, using information from the Sparkfun website.

This example just dumps the raw data.

ad8232.jpg


AD8232 Heart Rate Monitor image provided by SparkFun under CC BY-NC-SA-3.0.

// Instantiate a Ad8232 sensor on digital pins 10 (LO+), 11 (LO-)
// and an analog pin, 0 (OUTPUT)
upm::AD8232 *ad8232 = new upm::AD8232(10, 11, 0);
// Output the raw numbers from the ADC, for plotting elsewhere.
// A return of 0 indicates a Lead Off (LO) condition.
// In theory, this data could be fed to software like Processing
// (https://www.processing.org/) to plot the data just like an
// EKG you would see in a hospital.
while (shouldRun)
{
cout << ad8232->value() << endl;
usleep(1000);
}

Public Member Functions

 AD8232 (int loPlus, int loMinus, int output, float aref=AD8232_DEFAULT_AREF)
 
 ~AD8232 ()
 
int value ()
 

Constructor & Destructor Documentation

AD8232 ( int  loPlus,
int  loMinus,
int  output,
float  aref = AD8232_DEFAULT_AREF 
)

AD8232 constructor

Parameters
loPlusdigital pin to use for LO+
loMinusdigital pin to use LO-
outputanalog pin to use for reading the data
~AD8232 ( )

AD8232 Destructor

Member Function Documentation

int value ( )

return the current ADC value for the device output pin. If an LO (Leads Off) event is detected, 0 will be returned.

Returns
ADC value

The documentation for this class was generated from the following files: