Daniel Morley

adding variables

Discussion created by Daniel Morley on Dec 29, 2006
Latest reply on Dec 29, 2006 by Daniel Morley
Before any one jumps on my case I have read most of ansi C programming guide.  In the guide I did notice that to add one to an integer one simply  integer= integer + 1 or ++integer.  I have tried this and it does not seem to work. In the following code
 void ManualControl(){
   int position;
   int stop;
  if(Button1 == UP||Button2 == UP ) {
  while (Button1 == UP){
     //  if (stop==-1)
     // stop=15;
  while (Button2 == UP){
    //   if (stop==16)
  //    stop=0;
       while (position != stop) {
This code works fine till I add a 1 to stop and then it stays in the last while statement indefinitely.