Logging & Filtering

I am trying to maximize my on-board data storage by filtering the GPIO data.   I have tried to use both threshold and delta filters, but the device continues to log all data points, even when I set an impossible threshold value (nothing should pass through).   Any suggestions? 

SETUP:
MetaTracker
iPhone 6s
microphone gpio  (gpio)   

(In DeviceConfiguration.swift) 
cryingEvent = device.gpio?.pins.first?.analogAbsolute?.periodicRead(withPeriod: 10) 

(In viewController.swift)
//configuration.cryingEvent.change(ofEventAcrossThreshold: 0.7, hysteresis: 0, output: .absolute)
configuration.cryingEvent.changeOfEvent(byDelta: 3.0, output: .absolute) 
configuration.cryingEvent.startLoggingAsync() 

Comments

  • Your code only logs output from cryingEvent, not the outputs of its filters.  Call startLoggingAsync on the returned MBLFilter pointers.
  • Okay that makes sense.  Now when I make the following assignment: 


    modifiedCryingEvent = configuration.cryingEvent.changeOfEvent(byDelta: -3.0, output: .absolute)

            modifiedCryingEvent.startLoggingAsync()


    I get the error: 

    "Cannot assign value of type 'MBLFilter<AnyObject>' to type 'MBLEvent<MBLNumericData>!' "

    But I am unable to cast a different data type. Any suggestions. 

    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #e7e8eb}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #18b5b1}
    span.s1 {font-variant-ligatures: no-common-ligatures}
    span.s2 {font-variant-ligatures: no-common-ligatures; color: #18b5b1}
    span.s3 {font-variant-ligatures: no-common-ligatures; color: #00aaa3}
    span.s4 {font-variant-ligatures: no-common-ligatures; color: #e7e8eb}
  • How did you define the modifiedCryingEvent variable?
This discussion has been closed.