🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ECG Module code

    Modules
    2
    3
    6.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dsrc12
      last edited by dsrc12

      Please help me understand your code for this module
      I got this module to work on a m5stack Fire but I would like an explanation of the library program, ECG.ino at:
      https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/ECG

      There are no comments in the code which makes it hard to follow the program.
      There is also no data dictionary for the following terms:
      measurements
      ECG_IDLE
      ECG_DATA_LENGTH
      ECG_DATA_H
      ECG_DATA_L
      ECG_END

      parameters:
      ECGdataFSM
      ECGWritePoint
      ECGReadPoint
      ECGData
      DataMAX
      DataMIN

      Difficult to understand constructs
      What does the following do?

      ECGdataFSM = ( data == 0xAA ) ? ECG_DATA_LENGTH : ECG_IDLE;
      DataMAX = ( ECGData > DataMAX ) ? ECGData : DataMAX;
      DataMIN = ( ECGData < DataMIN ) ? ECGData : DataMIN;

      The documentation for this product at https://docs.m5stack.com/#/en/module/ecg?id=related-link
      states that the MPU STM32 in the module supports a heart rate statistics algorithm. What does this algorithm do? What parameters does it use?

      D 1 Reply Last reply Reply Quote 0
      • D
        dsrc12 @dsrc12
        last edited by

        @dsrc12: I have now got this to work and it works best if I discount the USB link to Fire. The code I had difficult understanding is based on a C++ Ternary Operator in C. Returns either ECG_Data_LENGTH if data equals 0xAA or ECG_IDLE if false. At least this is a start. Still need to decode the meaning of the parameters.

        1 Reply Last reply Reply Quote 0
        • KabronK
          Kabron
          last edited by Kabron

          It is very shame that the product is not accompanied with any documentation.
          Where is the detailed schematic?
          Where is the description of the FW?
          Where is the description of RawDisplay SW?
          Where is description of the passthrough serial?
          Where is protocol description?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post