Source code for pyupm_ad8232

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.





from sys import version_info
if version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_pyupm_ad8232', [dirname(__file__)])
        except ImportError:
            import _pyupm_ad8232
            return _pyupm_ad8232
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_ad8232', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_ad8232 = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_ad8232
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.


def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)

def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0



def getVersion():
    return _pyupm_ad8232.getVersion()
getVersion = _pyupm_ad8232.getVersion

_pyupm_ad8232.AD8232_DEFAULT_AREF_swigconstant(_pyupm_ad8232)
AD8232_DEFAULT_AREF = _pyupm_ad8232.AD8232_DEFAULT_AREF
[docs]class AD8232(_object): """ UPM module for the AD8232 Heart Rate Monitor. ID: ad8232 Name: Single Lead Heart Rate Monitor Category: medical Manufacturer: sparkfun Link:https://www.sparkfun.com/products/12650 Connection: gpio analog 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 underCC BY-NC- SA-3.0. C++ includes: ad8232.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, AD8232, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, AD8232, name) __repr__ = _swig_repr def __init__(self, loPlus, loMinus, output, aref=3.3): """ AD8232(int loPlus, int loMinus, int output, float aref=AD8232_DEFAULT_AREF) AD8232 constructor Parameters: ----------- loPlus: Digital pin to use for LO+ loMinus: Digital pin to use for LO- output: Analog pin to read the data aref: Analog voltage reference """ this = _pyupm_ad8232.new_AD8232(loPlus, loMinus, output, aref) try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_ad8232.delete_AD8232 __del__ = lambda self: None
[docs] def value(self): """ 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 """ return _pyupm_ad8232.AD8232_value(self)
AD8232_swigregister = _pyupm_ad8232.AD8232_swigregister AD8232_swigregister(AD8232) # This file is compatible with both classic and new-style classes.