Beispiel #1
0
def init(server=None, text='Helo', model=1, device_index=1):

    ''' Initialization. Must be called before creating the "patch".
    
        If several SoftStep's are connected to the computer,
        you can select the one you want with device_index.
    '''

    if model == 2:
        global _corner2offset
        global DEFAULT_THRESHOLD
        global DEFAULT_CURVE
        _corner2offset = _corner2offset_SS2
        DEFAULT_THRESHOLD = DEFAULT_THRESHOLD_SS2
        DEFAULT_CURVE = DEFAULT_CURVE_SS2
    
    if server is None:

        # make it global so that the object doesn't get garbage-collected
        global pyo_server
        
        pyo_server = pyo.Server()
        pyo_server.setMidiInputDevice(_find_device(device_index))
        pyo_server.boot()
        pyo_server.start()
    
    else:
        
        server.setMidiInputDevice(_find_device(device_index))

    hardware.init(text, device_index)
	def __init__(self, c):
		self.con = c
		hardware.init()
		self.f1 = -1
		self.f2 = -1
		self.enter = -1
		self.toy1 = -1
		self.toy2 = -1
		self.toy3 = -1
		self.proxsense = 0
Beispiel #3
0
import moodle

# Config
width = 480
height = 320
imgsdir = "imgs/"

# Setup touchscreen
os.environ['SDL_FBDEV'] = '/dev/fb1'
os.environ['FRAMEBUFFER'] = '/dev/fb1'
os.environ['SDL_MOUSEDEV'] = '/dev/input/touchscreen'
os.environ['SDL_MOUSEDRV'] = 'TSLIB'

# Init
pygame.init()
hardware.init()
screen = pygame.display.set_mode((width, height))
pygame.mouse.set_visible(False)

# Design
default_entries = ["Bitte USB-Stick einstecken"]

primary_color = (59, 78, 223)
background_color = (247, 251, 254)
seperator_color = (230, 233, 255)
#button_color = (235, 243, 255)
button_color = background_color
button_border_color = (59, 78, 223)
text_color = (60, 60, 60)
title_color = seperator_color
Beispiel #4
0
import string
import robotCode
import hardware
#makes it so no screen opens
os.environ["SDL_VIDEODRIVER"] = 'dummy'
#init the pygame and display setup
pygame.init()
pygame.display.init()
screen = pygame.display.set_mode([1,1])
#init the queue
pygame.fastevent.init()
#init the joystick
#js = pygame.joystick.Joystick(0)
#js.init()
#start the connection
hardware.init()
con1 = Connection()
#con2 = Connection()
con1.openListenPort(2000)
#con2.openListenPort(2001)
#start the timer
t=Timer()
t.startTimer()
#run the user init code
rc = robotCode.RobotCode(con1)
#queue processing loop
while True:
	#let the queue do what it needs
	pygame.fastevent.pump()
	#pull the next event
	ev = pygame.fastevent.poll()
Beispiel #5
0
def load_cameras():
    global cameras
    cameras = hardware.init()