MICILE EZ_PulseOx Documentation
version: 0.9
A few notes about our documentation:
  • The intentions of this documentation are to keep things simple.
  • Please see the examples at the end of each section for concrete examples of how to use each function.
  • If in doubt how to use a function, experiment!
  • We don't believe in writing more words just to make the documentation look more substantial
  • Quick Reference
    Function List
    Compatible Devices
    Contect CMS-50D+ with USB

    * Please contact us for information on adding support for a device.

    PulseOx Functions
    pulseox_connect(type='CMS50D+', serial_port='/dev/ttyUSB0')
    Connects to the pulse oximeter. The type and serial_port parameters can be omitted since the default values should work just fine.
    Clears all pending data from the pulse oximeter data buffer.
    Returns True if there is data available in the pulse oximeter data buffer. Returns False if not data is available.
    Pops a data item off the pulse oximeter data buffer. Each data item contains the following attributes:
    pulse_rate - Pulse rate detected by the pulse oximter in beats per minute
    sample_rate - The number of data items sampled per minute by the pulse oximeter
    spo2_rate - The current blood oxygen saturation measurement
    wave_y - The y position of the plethysmograph waveform showing the change in blood volume
    # --------------------------------------------------
    # pulseox_demo.py
    # --------------------------------------------------
    # import the graphics library and the pulse oximeter library
    from ez_graphics_09 import *
    from ez_pulseox_09 import *
    # Connect to the pulse oximeter
    # clear the screen
    sw = get_screen_width()
    sh = get_screen_height()
    # draw some nice graphics
    draw_text('Pulse Rate'50010)
    # Main Loop
    x = 0
    while True:
        # draw the wave form for every data point    
        d = None
        while pulseox_has_data():
            # get the latest data
            d = pulseox_pop_data()
            # update the waveform graph
            draw_line(xsh - 128xsh - d.wave_y)
            draw_line(xsh - d.wave_yxsh)
            x = (x + 1) % sw
        # only update the pulse and spo2 the last sample
        if d is Nonecontinue

    pulseox demo