upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
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 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.jpg


AD8232 Heart Rate Monitor image provided by SparkFun under CC BY 2.0.

// Instantiate a Ad8232 sensor on digital pins 10 (LO+), 11 (LO-)
// and an analog pin, 0 (OUTPUT)
upm::AD8232 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;
upm_delay_us(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 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.

Returns
ADC value

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