Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
Which processor and programming language?A software delay is pretty simple.set a variable to a valuedecrement the variabletest the variable for equal to zeroif not = 0 then go back and decrement again.if = 0 exit
void delay_1sec (void) { int i, j; for( i=0; i<X; i++) { for( j=0; j<Y; j++) { ; } }}Is how I would do a generic long delay.X and Y are constants that need adjustment to get 1 second for your processor speed and compiler's code.
Quote from: waltr on July 19, 2010, 03:15:17 PMvoid delay_1sec (void) { int i, j; for( i=0; i<X; i++) { for( j=0; j<Y; j++) { ; } }}Is how I would do a generic long delay.X and Y are constants that need adjustment to get 1 second for your processor speed and compiler's code. as long as your compiler's optimisation is switched off.dunk.