IOS Filter Bugs?

Either I'm missing something in the docs... or the IOS filters might have some bugs?

Is there any reason this should not work

MBLEvent<MBLNumericData *> *topEvaluator = [device.accelerometer.zAxisReadyEvent compareEventUsingOperation:MBLComparisonOperationLessThan withData:0.8];

                MBLDataSwitch<MBLNumericData *> *turnOfLightTop = [topEvaluator conditionalDataSwitch:NO];

                [turnOfLightTop programCommandsToRunOnEventAsync:^{

                    [device.led setLEDOnAsync:NO withOptions:1];

                    [turnOfLightTop resetConditionalAsync:NO];

                }];


MBLEvent<MBLNumericData *> *filterAccelerometerBack = [device.accelerometer.zAxisReadyEvent compareEventUsingOperation:MBLComparisonOperationGreaterThan withData:0.8];

                MBLEvent<MBLNumericData *> *filterPeriodicBack = [filterAccelerometerBack periodicSampleOfEvent:5000];

                [filterPeriodicBack programCommandsToRunOnEventAsync:^{

                    

                    [turnOfLightTop resetConditionalAsync:YES];

                    [device.led setLEDColorAsync:[UIColor blueColor] withIntensity:1.0];









                }];


This code I believe should check the accelerometers Z axis and when the data is below 0.8 (which I can confirm it does)... it will turn on the light and then set the "switch" to turn on the filter to look for the data going below 0.8...  Once it goes below 0.8 the light should turn off and the conditional switch will be turned off.



This discussion has been closed.