differences with MetaWear R and MetaWear RG/PRO?

edited October 2015 in iOS
I've been following the freefall movies on youtube, and so far I have my MetaWare R working.

I've set the LED to flash 5 times once connected (to the closest MetaWear), and then flash green 3 times when you segue to the freeFallViewController and can detect the accelerometer data in the log and in a label on the view. I also have set up another view controller which flashes the LED red 3 times when you segue to it. This all works fine ;-)

When I try my MetaWear R/PRO it connects fine, but the code won't trigger the LED flashes when you enter the other ViewControllers. I'm aware the accelerometer is different between the two boards (question coming about that next..) but the LED should flash different colors after each segue...?

any thoughts / tips would be appreciated!


edit - p.s. my project is available here: https://github.com/mrwilljackson/metawear

Comments

  • edited October 2015
    I've made an amendment to my 'freefall' project and have found the following:

    If I pass the (metaware) device to the next ViewController using:
        if([segue.identifier isEqualToString:@Freefall]) {
    FreeFallViewController *destination = segue.destinationViewController;
    destination.device = self.device;
    }
    and my destination ViewController has a property ready to be set - then the metawear RPRO stays connected and functions as expected.

    Using:
    [[MBLMetaWearManager sharedManager] retrieveSavedMetaWearsWithHandler:^(NSArray *array) {
    self.device = array[0];
    }
    (as shown on youtube iPhone dev part c) doesn't seem to work with a metawear RPRO but works fine with the metawear R. maybe it will help anyone else?
  • I imagine it has to deal with the fact you are using 2 different boards with the app, but have it hardcoded to use array[0].

    When you call rememberDevice it will be persisted to disk and saved indefinitely.  When you used the app with MetaWearR it was saved to slot 0 in the saved MetaWears array, then when you used your MetaWear RPRO it would of been saved to slot 1.

    In this case since I would recommend just passing the MetaWear device to the different controllers.  The rememberDevice is really intended for apps that will only every reconnect to the same MetaWear. 




  • Thanks Stephen!

    that is absolutely correct, I logged out the array of devices and found several metawears present which explains by only one of them appeared to remain connected to my app when I progressed to the second view controller, and tried to resume communication with the metawear at slot 0.

    ;-)

This discussion has been closed.