[visionegg] pseudorandom
- From: richard srebro <dick@xxxxxxxxxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Tue, 08 Mar 2005 14:25:36 -0600
I am trying to get a length 511 pseudorandom m sequence to control the
phase of a checkerboard. The two checkerboards are preconstructed. CC is
one checkerboard. CP is the counterphase checkerboard. I also want a
signal that shows the checkerboard phase. Here is the control script
that I am using
LPT1 = 0x378
def control_dynamic(t):
if t<= dynamic_time:
tt=(int(t*100)%511)
if ps[tt]== 0:
dynamic_texture_object.put_sub_image( CC )
data = 0x00
raw_lpt_module.out(LPT1,data)
else:
dynamic_texture_object.put_sub_image( CP )
data = 0xFF
raw_lpt_module.out(LPT1,data)
p.add_controller(None,None,FunctionController(during_go_func=control_dynamic))
p.go()
There are two problems.
(1) tt=(int(t*100)%511) does not give an ordinal sequence. For example
it gives 0,1,2,3,4,5,7,etc skipping up every 6 to 7 positions.I
understand why but I have not been able to find a way to get a counter
going within the control loop. If I try a statement like cnt=cnt+1, it
increments once and that is all.
(2) every once in a while the screen stops updating the display, usually
with one or the other checkerboard displayed statically
or on occasion with a blank screen. However, LPT1 goes on happily
changing. I can get the screen to resume displaying the checkerboards
if I move the mouse around in the "Konsole" window. If I keep the
"Konsole" window visible and keep the cursor in it, the display does
not stop updating.
I am using an Nvidia board and the displays are free of any tears
and refreshing at 85 Hz.
I am operating with Fedora Core 2.
Thanks for any help you can give me
Dick Srebro
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- Follow-Ups:
- [visionegg] Re: pseudorandom
- From: Andrew Straw
Other related posts:
- » [visionegg] pseudorandom
- » [visionegg] Re: pseudorandom
- » [visionegg] Re: pseudorandom
- » [visionegg] Re: pseudorandom
- [visionegg] Re: pseudorandom
- From: Andrew Straw