/// <summary> /// Testing method for PulseOximeter module /// </summary> static void TestOximeter() { PulseOximeter ox = new PulseOximeter(FEZSpiderII.Socket4.SerialPortName); ox.ProbeAttached += (sender, e) => { Debug.WriteLine("probe attached."); }; ox.ProbeDetached += (sender, e) => { Debug.WriteLine("probe detached."); }; ox.Heartbeat += (sender, e) => { Debug.WriteLine($"SPO: {e.SPO2} ,Pulse:{e.PulseRate}"); }; Thread.Sleep(Timeout.Infinite); }
/// <summary> /// Sets the global flag which verifys the probe is attached /// </summary> /// <param name="sender">The object that fired the event</param> void pulseOximeter_ProbeDetached(PulseOximeter sender) { Debug.Print("Probe Detached"); ProbeAttached = false; }
/// <summary> /// Sets the global flag which verifys the probe is not attached /// </summary> /// <param name="sender">The object that fired the event</param> void pulseOximeter_ProbeAttached(PulseOximeter sender) { Debug.Print("Probe Atttached, begining to take vitals"); ProbeAttached = true; }
/// <summary> /// Checks if the probe is attached, if it is, the reading object is used to set the currentReading object /// and led is pulsed also to show the user that the pulse is being read /// </summary> /// <param name="sender">The object that fired the event</param> /// <param name="reading">The reading taken by the object</param> void pulseOximeter_Heartbeat(PulseOximeter sender, PulseOximeter.Reading reading) { PulseDebugLED(); if (ProbeAttached) { CurrentReading.Init(reading); lED7R.Animate(reading.PulseRate, true, true, false); Debug.Print("heartrate: " + reading.PulseRate + " SPO2 " + reading.SPO2 + " signal " + reading.SignalStrength); Debug.Print("Serialised string :" + CurrentReading.SerialiseBpm()); } }
void pulseOximeter_Heartbeat(PulseOximeter sender, PulseOximeter.Reading reading) { lED7R.Animate(50, true, true, false); DisplayPulseRate(reading.PulseRate); }
public void Init(PulseOximeter.Reading Reading) { m_BPM = Reading.PulseRate; }