Source code for pyupm_adxrs610

# 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_adxrs610', [dirname(__file__)])
        except ImportError:
            import _pyupm_adxrs610
            return _pyupm_adxrs610
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_adxrs610', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_adxrs610 = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_adxrs610
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_adxrs610.getVersion()
getVersion = _pyupm_adxrs610.getVersion

_pyupm_adxrs610.m_degreeCoeff_swigconstant(_pyupm_adxrs610)
m_degreeCoeff = _pyupm_adxrs610.m_degreeCoeff

_pyupm_adxrs610.m_temperatureCoeff_swigconstant(_pyupm_adxrs610)
m_temperatureCoeff = _pyupm_adxrs610.m_temperatureCoeff

_pyupm_adxrs610.m_temperatureNom_swigconstant(_pyupm_adxrs610)
m_temperatureNom = _pyupm_adxrs610.m_temperatureNom
[docs]class ADXRS610(_object): """ DFRobot ADXRS610 Gyro Breakout board. ID: adxrs610 Name: Gyro Breakout Board (300 Degrees/second) Other Names: ADXRS610 Category: compass Manufacturer: dfrobot Link:http://www.dfrobot.com/index.php?route=product/product&product_id=642 Connection: analog The ADXRS610 is a MEMS based single axis gyroscope with a range of +/- 300 degrees/sec. It also incorporates a temperature sensing unit that can be used for advanced calibration. This sensor returns an analog voltage proportional to the rotation about the Z-axis in degrees/sec. The temperature component returns a proportional analog values in degrees C. This driver was developed using the DFRobot ADXRS610 Gyro Breakout board. C++ includes: adxrs610.hpp """ __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, ADXRS610, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, ADXRS610, name) __repr__ = _swig_repr def __init__(self, dPin, tPin, aref=5.0): """ ADXRS610(int dPin, int tPin, float aref=5.0) ADXRS610 constructor Parameters: ----------- dPin: Analog pin to use for DATAOUT tPin: Analog pin to use for temperature measurement aref: Analog reference voltage; default is 5.0 V """ this = _pyupm_adxrs610.new_ADXRS610(dPin, tPin, aref) try: self.this.append(this) except Exception: self.this = this __swig_destroy__ = _pyupm_adxrs610.delete_ADXRS610 __del__ = lambda self: None
[docs] def getDataVolts(self): """ float getDataVolts() Returns the voltage detected on the DATA analog pin The detected voltage """ return _pyupm_adxrs610.ADXRS610_getDataVolts(self)
[docs] def getTemperatureVolts(self): """ float getTemperatureVolts() Returns the voltage detected on the TEMP analog pin The detected voltage """ return _pyupm_adxrs610.ADXRS610_getTemperatureVolts(self)
[docs] def setDeadband(self, deadband): """ void setDeadband(float deadband) This method allows you to specify a deadband region around the zero point of the gyro (at rest). This can be used as a primitive filter to ignore movment around the zero point. Parameters: ----------- deadband: The voltage around the zero point which will be ignored """ return _pyupm_adxrs610.ADXRS610_setDeadband(self, deadband)
[docs] def setZeroPoint(self, zeroPoint): """ void setZeroPoint(float zeroPoint) Set the zero point. This is the point measured and averaged when the sensor is not moving. It is set at construction time (averaged over a number of samples), but can be overridden here. Parameters: ----------- zeroPoint: The averaged zero point of the sensor at rest """ return _pyupm_adxrs610.ADXRS610_setZeroPoint(self, zeroPoint)
[docs] def calibrateZeroPoint(self, samples=50): """ float calibrateZeroPoint(unsigned int samples=50) This method samples the data pin samples times to produce an average. This value can then be used as the zero point ( setZeroPoint()). Parameters: ----------- samples: the number of samples to take an average over. The default is 50. the average of the reading over samples times. """ return _pyupm_adxrs610.ADXRS610_calibrateZeroPoint(self, samples)
[docs] def getZeroPoint(self): """ float getZeroPoint() Return the zero point value. the current zero point value """ return _pyupm_adxrs610.ADXRS610_getZeroPoint(self)
[docs] def getTemperature(self): """ float getTemperature() Return the measured temperature in Celsius. Note, the datasheet says that this value is very repeatable, but is not an accurate absolute temperature. the current temperature in C """ return _pyupm_adxrs610.ADXRS610_getTemperature(self)
[docs] def getAngularVelocity(self): """ float getAngularVelocity() Return the measured angular velocity in degrees/sec. the current angular velocity in degrees/sec """ return _pyupm_adxrs610.ADXRS610_getAngularVelocity(self)
ADXRS610_swigregister = _pyupm_adxrs610.ADXRS610_swigregister ADXRS610_swigregister(ADXRS610) # This file is compatible with both classic and new-style classes.