Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Super Contributor
lyon819
Posts: 253
Registered: ‎08-19-2010
My Carrier: TT
Accepted Solution

Can someone check the code, which has a wrong point.?

[ Edited ]

Tried to use buffer to collect acceleration, but fail.

Could anyone help me to debug??

 

if(paused==2){
                            for (i =0; i < 2; i++){
                                sensor_event_get_xyz(event, &force_x[i], &force_y[i], &force_z[i]);
                                if(force_x[0] != force_x[1]){
                                //if(tmb[0].millitm-tmb[1].millitm > 19){fail without data

                                    ftime(&tmb[i]);
                                    fprintf(f,"%ld%d, %7.3f, %7.3f, %7.3f\n", tmb[i].time, tmb[i].millitm, force_x[i], force_y[i], force_z[i]);
                                }
                            }

 

Thank you,

 

-Fight with BB10
Please use plain text.
Administrator
MSohm
Posts: 13,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Can someone check the code, which has a wrong point.?

You are trying to read accelerometer data without checking if the data is ready (event occurred).  Have a look at the following link for an example.

 

Reading accelerometer forces

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 550
Registered: ‎11-29-2011
My Carrier: other

Re: Can someone check the code, which has a wrong point.?

Hi lyon819,

You have started multiple threads asking the same or similar questions (I just counted maybe 8 or 9 threads which only covered 2 or 3 questions).  Can you please try to direct your related questions to a thread you have already started?  Someone reading a question in one of your threads may not notice that it has already been answered in another thread.

 

Cheers,

Sean

Please use plain text.