bpm prueba arduino

Download Bpm Prueba Arduino

If you can't read please download the document

Upload: paromarye1

Post on 03-Feb-2016

8 views

Category:

Documents


1 download

DESCRIPTION

Bpm Prueba Arduino

TRANSCRIPT

// Ensure this library description is only included once//#ifndef eHealthClass_h//#define eHealthClass_h// Library interface descriptionclass eHealthClass { public: // Constructor of the class * //! Class constructor. eHealthClass(void); // Public Methods * //! Initializes the position sensor and configure some values. /*! //! Initializes the BloodPressureSensor sensor and configure some values /*! \param float parameter with correction value \return void */ void readBloodPressureSensor(void); //! Returns the heart beats per minute. /*! \param void \return int : The beats per minute. */ int getBPM(void); //! Returns the value of the systolic pressure. /*! \param void \return int : The systolic pressure. */ int getSystolicPressure(int i); //! Returns the value of the diastolic pressure. /*! \param void \return int : The diastolic pressure. */ int getDiastolicPressure(int i); //!Returns the number of data stored in the blood pressure sensor. /*! \param void \return int : length of data */ uint8_t getBloodPressureLength(void); //! Convert month variable from numeric to character. /*! \param int month in numerical format. \return String with the month characters (January, February...). */ String numberToMonth(int month); //!Struct to store data of the blood pressure sensor. struct bloodPressureData { uint8_t year; uint8_t month; uint8_t day; uint8_t hour; uint8_t minutes; uint8_t systolic; uint8_t diastolic; uint8_t pulse; }; //!Vector to store the blood pressure measures and dates. bloodPressureData bloodPressureDataVector[8]; private: // Private Variables * //! It stores the systolic pressure value int systolic; //! It stores the diastolic pressure value int diastolic; //! It stores the beats per minute value. int BPM; };extern eHealthClass eHealth;//////////////////// Constructor of the class * //! Function that handles the creation and setup of instances eHealthClass::eHealthClass(void) { /*void constructor*/ } // Public Methods * //!****************************************************************************** //! Name: readBloodPressureSensor() * //! Description: Initializes the BloodPressureSensor sensor. * //! Param : void * //! Returns: void * //! Example: eHealth.initBloodPressureSensor(); * //!****************************************************************************** void eHealthClass::readBloodPressureSensor(void) { unsigned char _data; int ia=0; length=0; Serial.begin(19200); Serial.write(0xAA); delayMicroseconds(1); Serial.write(0x55); delayMicroseconds(1); Serial.write(0x88); delay(2500); Serial.print("\n"); if (Serial.available() > 0) { // The protocol sends the measures for (int i = 0; i