Accelrometer on windows

Hi, I am trying to get the sample code to work but am unable to get any sensor readings back from my device.  The simplest case I can find is to just get back the orientation values, so that is what I would like to do for now.  I believe that the steps should be:

1. Initialize the device
2. Add callback
3. enable orientation component.

and after that I should receive notifications when the device orientation changes or at some interval, I'm not sure which.  But I never receive any call backs.  

If I read the temperature, I do receive a callback, so I am pretty sure that part is working.

Any suggestions would be appreciated.

Thanks!

Comments

  • The Windows API creator has not been active on these forums in 9 months.  We do not officially support a Windows API so your best bet would be to contact the author directly.
  • Hi Eric, do you have the authors contact information?  I've posed on the codeplex site but have not heard from them.

    If not, can you at least confirm the sequence of commands that should be sent to the board in order to get it into orientation mode and calling back with values?

    My understanding is this:
    Enable Notifications for characteristic (326a9006-85cb-9195-d9dd-464cfbbae75a)

    write to command characteristic(326a9001-85cb-9195-d9dd-464cfbbae75a) the following values:
    start orientation - [3, 8, 1]
    enable notifications - [3,2,1]
    start accelerometer - [3,1,1]

    If there is some data setup, or some different order that these commands need to be sent to the board? Is there any documentation that you can send to me on the parameters for each module?

    Thanks!
  • For orientation, you need to enable the detection, configure the sensor, and then enable notifications:

    0x03 - 0x08 - 0x01
    0x03 - 0x09 - 0x00 - 0xc0 - 0x0a - 0x00 - 0x00
    0x03 - 0x0a - 0x01

    Once you've done that, you write [0x03 - 0x01 - 0x01] to start the accelerometer and notifications come in the form: [0x03, 0x0a, XX].


  • Thanks Eric, That is exactly what I needed.  When I try this, I am still not receiving any callbacks.  

    When I call read temperature [0x04 - 0x81 - 0x00] I receive the callback message right away.  Is there a delay from when I start the accelerometer [0x03 - 0x01 - 0x01] to when I should receive the first callback?
  • Actually...which board do you have?  R or RG/Pro?
  • I have both a R and and RG, but my understanding is that orientation is only supported on the R, so that is what i am testing with.  If you have the sequence that I need for enabling axis sampling, and starting that up I can try that on either device.
  • edited August 2015
    Both boards support orientation, we have not yet tested all the configuration options on the RG chip so the Android and iOS libraries have not exposed them for now.

    The byte string enables orientation on the R board.  If the windows library does not give you callbacks, perhaps orientation is not supported on that library.  If you have an app that can communicate with the board directly (on Android and iOS, we use the Nordic Master Control Panel app), you can use it to send those commands to the board to try it out.

    If you want to try out orientation on the RG board, send:

    // Start
    0x03 - 0x0F - 0x01 - 0x00
    0x03 - 0x11 - 0x01
    0x03 - 0x01 - 0x01

    //Stop
    0x03 - 0x01 - 0x00

    Notifications come in the form: 0x03 - 0x11 - XX
  • @gtarbell could you please share your app if you sucessfully talk to MetaWare from windows ? Thanks !
  • Thank you so much @eric, I have it working now.  

    @JpEncausse, I have it working on windows/windows phone, and I will post a link here when it is a bit more cleaned up.
  • @gtarbell Awesome! Can you post what you have so far whenever you get a chance?
  • Hi @jrood, here is a very basic implementation


    I am cleaning up and creating a better example, which I hope to check in tomorrow.  If you have any requests, or want to contribute let me know.

  • Cool thanks! Maybe I'm missing something, but the MetaWear.Windows.API project seems to be empty (aside from a blank Class1 definition).
  • The version I had up there was a rough draft.  Functional, but not elegant.  Please take a look now.  the API is much more what I had in mind. 

    There is still much more to do, but if the community has any suggestions on what to tackle next, I would love to hear their thoughts.
  • @gtarbell Sweet, thanks! I'm not sure if I'll be able to make a meaningful contribution to this or not, but I'll let you know what I'm thinking as I mess around with it.
  • Actually, now that there's a c++ api, I think i'm going to direct my attention that way.
  • @jrood, sweet!!! Can't wait to see your new implementation! Keep us updated.
This discussion has been closed.