Forum Discussion
Altera_Forum
Honored Contributor
13 years agoThank you for your answers, they really helped me :)
What i did is that is ask the user to press a button to start using the program. Until the user presses the button, a variable increments itself. I show you my code :
do
{
if(*switches==0)
{
LCD_Test("Switch up SW0", "To continue");
while(*switches==0)
{
if(highPrecisionTimer>100000000)
highPrecisionTimer=0;
highPrecisionTimer++;
}
keepGoing = 1;
}
else if(*switches==1)
{
LCD_Test("Switch down SW0", "To continue");
while(*switches==1)
{
if(highPrecisionTimer>100000000)
highPrecisionTimer=0;
highPrecisionTimer++;
}
keepGoing = 1;
}
}while(keepGoing != 1);
srand(highPrecisionTimer);
So now my rand() function works. Thank you !