upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
AD8232 Class Reference

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

Detailed Description

Note: this sensor must be driven at 3.3V only.

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

Processing (https://www.processing.org/) is software that should work, using information from the SparkFun* website.

This example just dumps the raw data:


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;

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

loPlusDigital pin to use for LO+
loMinusDigital pin to use for LO-
outputAnalog pin to read the data
arefAnalog voltage reference
~AD8232 ( )

AD8232 destructor

Member Function Documentation

int value ( )

Returns the current ADC value for the device output pin. If an LO (leads off) event is detected, 0 is returned.

ADC value

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