Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.31/5 (5 votes)
See more:
I have a program in windows phone that calculate no of steps and aldo no of jummping I use this algorithm to create the app but It doesn't work perfect can any one help me with a better code or any modification to this code
thanx in advance


C#
if(M>=2)
           {
               if(magnitude==true)
               {
                   count = count + 1;
                   magnitude = false;

               }
               else
               {
                   magnitude = true;
               }

               if (IsWalking)
               {
                   TextBlock_CountStep_Center.Text = (count*2).ToString();
                   TextBlock_CounterStep_Cornner.Text =( count*2).ToString();

               }
               if (IsJumping)
               {
                   TextBlock_CountStep_Center.Text = (count / 2).ToString();
                   TextBlock_CounterStep_Cornner.Text = (count / 2).ToString();
               }
           }
Posted
Comments
Dave Kreskowiak 14-May-14 8:54am    
This isn't an algorithm for calculating much of anything. We have no idea what "count" is and where you're getting your data from or what it represents.

You also have said anything about what's wrong with this code and it what way you want this improved so there's little to nothing anyone can tell you that's going to be of any use.
Hala Mahmoud 14-May-14 19:05pm    
I get my data from accelerometer and m represnets magnitude
Dave Kreskowiak 15-May-14 0:04am    
...and?
[no name] 14-May-14 8:54am    
How are we to know what it is that you mean by "doesn't work perfect" unless you tell us?
Hala Mahmoud 14-May-14 19:07pm    
Some times it count the steps perfect and in the other time it doesn't gave me true data ( no of steps )

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900