Accelerometer Data in Object?
Posted: Tue Mar 12, 2013 10:31 pm
Hi guys!
I am trying to create a moving graph of accelerometer data. In my stack, I have the following code:
This works perfectly and updates the field with ax, ay and az constantly.
I also have a button "StartTracking" (with the same global variables called at the top) and calls mobileStartTrackingSensor "acceleration". I have a variable, "sCollect" which I use for the relative points of the line. I cannot find a way of "sending" ax, ay and az from the stack to the object so that they can be used. The global variable doesn't seem to be working as I initially had a test answer dialog to show me az, but it simply wrote the letters az instead of whatever variable was actually in az.
Any thoughts? Your help is much appreciated!
I am trying to create a moving graph of accelerometer data. In my stack, I have the following code:
Code: Select all
global ax, ay, az
on accelerationChanged ax, ay, az
put "AccelX: " & ax & return & "AccelY: " & ay & return & "AccelZ: " & az & return into field "Accel"
end accelerationChanged
I also have a button "StartTracking" (with the same global variables called at the top) and calls mobileStartTrackingSensor "acceleration". I have a variable, "sCollect" which I use for the relative points of the line. I cannot find a way of "sending" ax, ay and az from the stack to the object so that they can be used. The global variable doesn't seem to be working as I initially had a test answer dialog to show me az, but it simply wrote the letters az instead of whatever variable was actually in az.
Any thoughts? Your help is much appreciated!