Beispiel #1
0
from pypixxlib.propixx import PROPixx, PROPixxCTRL
from pypixxlib._libdpx import DPxSelectDevice
my_device = PROPixx()
my_device_controller = PROPixxCTRL()

my_device.setRearProjectionMode(
    True)  # Sets the projector to read-projection mode.
my_device.setCeilingMountMode(
    True)  # Sets the projector to ceiling-mount mode.
my_device.setVesaFreeRun(
    True)  # Sets the VESA port to work with the polariser.
my_device.updateRegisterCache()  # Update the new modes to the device.
my_device.setCustomStartupConfig(
)  # The projector will remember this configuration.
# The audio is done on the controller, so the next functions use the controller object.
my_device_controller.audio.initializeCodec()  # Configures initial CODEC state.
my_device_controller.audio.setLeftRightMode(
    'mono')  # Set which mode the audio will be output.
my_device_controller.audio.setAudioBuffer(
    0, 64)  # Set the audio to start at address 0, and size 64.

# Now we must create the audio stimulus.
# This is done by simply filling a list with a sound wave.
audio_stim = []
import math
for i in range(32):
    audio_stim.append(int(32767 * math.sin(2.0 * math.pi * i / 32.0)))
my_device_controller.writeRam(
    0, audio_stim)  # Write the audio stimulus in the ram.
my_device_controller.audio.setVolume(0.25)
my_device_controller.updateRegisterCache()  # Send everything to the device.
from pypixxlib._libdpx import DPxSelectDevice, DPxSetReg16, DPxUpdateRegCache
import ctypes
from pypixxlib.propixx import PROPixx

dev = PROPixx()
dev.setDlpSequencerProgram('RGB')
dev.setVesaFreeRun(False)
dev.updateRegisterCache()
DPxSelectDevice('PROPixx')  # Select the PROPixx
DPxSetReg16(ctypes.c_uint(0x18C), ctypes.c_uint(1))
DPxUpdateRegCache()