2014년 12월 9일 화요일

Pulling information from Accelerometer and putting it into labels at intervals

So here is what I'm trying to do. I'm trying to capture the yValue from my Accelerometer on my Tablet and put it into separate labels at a set time interval. I'm am creating an app that will log the launching of my drag car for the first 15 seconds. So I will do my burn out and then hit the start button on a tablet that is mounted to a fixture in my passenger seat. When I launch I want to capture that data in data fields so that I can plug the numbers into a Google Fusion Table.

The logic looks like this:

Hit Start Button then:
insert yValue from accelerometer into Label1 - then wait 500 milliseconds - capture accelerometer yValue data again and put it into Label2 - then wait 500 milliseconds - capture yValue of accelerometer and put into Label3 - wait 500 milliseconds - do this until we reach Label30 and then stop the looping.

Then at the end of the loop of 15 seconds I would have 30 Label fields filled up with yValue from the accelerometer. 

And that is where I'm stuck. Once I gather this information I know what to do. But I just can't figure out how to do the above. Any help is much appreciated. Thank you in advance.




http://www.appinventor.org/Chapter18


and perhaps it would be easier to put all that data into a single label?    set label1.text to   join  label1.text
                                                                                                                                                     \n
You will need some IF statements a clock a label and to understand how to loop (see above).  If you want to save the data, you will need a TinyDB or use a File control to save a csv type file with all the recorded data.

Try some blocks, post a screen capture image of what you are specifically having difficulty with and you will get advice


댓글 없음:

댓글 쓰기