Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need method to create 640*480 random data @ 60 Hz and update to scr.

Status
Not open for further replies.

holydragon

Electrical
Jan 30, 2003
5
0
0
Need method to create 640*480 random data @ 60 Hz and update to scr.

I have been working with this problem for the last few days. I'm simply trying to create an array fo 640X480 randomly shaded pixels and update them to a display (or mask with another array) at the rate of 60 Hz. The video is to be continuous and unique. Any ideas on completing this would be helpful!

Best Regards!
 
Replies continue below

Recommended for you

Hi !

Do you think this is quick enough. I think it takes a while to repeat itself. The value for the seed is not really important.

/* Generate pseudo randon numbers for video: */

#define MAX_PIX 256
static double seed = 0.6287393495854736252536643784327L;

/*... */

int pixle;

seed = seed * 147.0;
seed = seed - (int)seed;
pixle = (int)(seed * MAX_PIX);

 
Status
Not open for further replies.
Back
Top