Author Topic: Tilting Trigger on the Accelerometer  (Read 4008 times)

Nick_W

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: Tilting Trigger on the Accelerometer
« on: February 27, 2017, 03:26:54 pm »
Yes, there are some bugs is mcStudio. To get the shared function to work you have to:

Code: [Select]
Dim value as Float = MotionLocation.getOrientation(0)

Then use value in your SigFox publish. I know it's a pain and it does work as is, but Private is not correct (because your class is not instantiated)- this isn't the problem though.

The range isn't 0 to 1 as such, it's +/- range so whatever you set in setup (2G I think, so it would be +/-2.0), it's just that earths gravity is 1.0, so if the module is not moving, you should get +/-1.0 on one axis, and 0 on the others, if the module is level.

Why you get 3.961e+28 for the X axis, I don't know, but the values from the accelerometer are correct. have you tried just substituting fake numbers (like 0.01 and 1.01) for the X,Y,Z float values, and see what shows up in losant? I suspect the math is wrong somewhere in the SigFox - losant chain.

How are you extracting the float in Losant? it's an IEE float representation so it's not a simple extract unless losant has a way of extracting IEE floats.