WAIT(1) does not work, WAIT(0.1) does

Questions about the BASICtools and MakeItC
Post Reply
AtlantaRobotics
Posts: 4
Joined: Wed Feb 06, 2013 5:29 pm
Location: Atlanta GA, USA
Contact:

WAIT(1) does not work, WAIT(0.1) does

Post by AtlantaRobotics »

I am programming in C and do not understand why the following statements do not work:
WAIT (1); // Wait 1 millisec
WAIT (1.1); // Wait 1.1 millisec
WAIT (1.0); // Wait 1 millisec
WAIT (10); // Wait 10 millisec

but these ones work fine:

WAIT (0.001); // Wait 1 usec
WAIT (0.1); // Wait 100 usec

My code freezes when I do this and it only works if the function has a 0.xx value passed. I do not see WAIT in any of my include files. I looked in the ANSI C and GNU C library manuals and did not see it listed. I am using an NXP LPC1756 M3 Cortex uP if it matters (Super Pro).


Regards,

Jebadiah Moulton
Atlanta Robotics LLC
Atlanta,GA
www.Atlanta-Robotics.com

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: WAIT(1) does not work, WAIT(0.1) does

Post by basicchip »

The parameter for WAIT is defined as an integer, so anything else is up to the conversion whims of the compiler.

You can always search for the definition in MakeItC

Post Reply