1 Reply Latest reply on Mar 3, 2011 2:10 AM by graa

    Simple Delay Function

    craig.winningham

      Can anyone explain explain to me how to set up a simple delay function? Is there a #include delay.h that goes up top?

         

      I have the delay.h header file in my source code.

         

      Is this the correct way to write the delay function?

         

      if((PRT0DR & 0x02) == 0x02)

         

      {

         

        PRT1DR = 0x01;

         

        Delay50uTimes(255);

         

        PRT1DR = ~0x01;

         

      }

         

      Any help would be greatly appreciated.

         

      Thank you