Can't access accelerometer data stream on Free Fall tutorial

I'm having the most basic problem here...I can't get an accelerometer data stream (or gyroscope) to access raw x, y, z data in the Free Fall tutorial. Nothing shows up on my log:

- (IBAction)startAccelerometer:(id)sender {

    NSLog(@Here);

    [self.device.accelerometer.dataReadyEvent startNotificationsWithHandlerAsync:^(MBLAccelerometerData *obj, NSError *error) {

        NSLog(@Hello?);

        NSLog(@X = %f, Y = %f, Z = %f, obj.x, obj.y, obj.z);

    }];

}


The first NSLog statement runs, the second one doesn't. I feel like I've tried everything...latest versions of firmware, Xcode, iOS, etc. I know that my CPRO works from the MetaWear test app.


The app connects to the board...Log output is:


2016-07-30 22:13:26.514 FreeFall[3173:1189185] Here


Any suggestions are greatly appreciated. Thank you.

Comments

  • I would first set a breakpoint on the call to startNotificationsWithHandler and double check that the self.device.accelerometer.dataReadyEvent object does exist.  It's possible that either the device object isn't set or the MetaWear isn't connected (which could result in nil accelerometer object)
This discussion has been closed.