예제 #1
0
import string
import driverCode
import ipInfo
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
ip = ipInfo.IpInfo()
con = Connection()
#con.openConnection('192.168.0.100')
con.openConnectionPort(ip.ip, ip.port)
#con.openConnectionPort('127.0.0.1', 2001)
#start the timer
t=Timer()
t.startTimer()
#run the user init code
dc = driverCode.DriverCode(con)
#queue processing loop
while True:
	#let the queue do what it needs
	pygame.fastevent.pump()
	#pull the next event
	ev = pygame.fastevent.poll()
	if ev.type == pygame.NOEVENT:
예제 #2
0
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()
con = Connection()
con.openListen()
#start the timer
t = Timer()
t.startTimer()
#run the user init code
rc = robotCode.RobotCode(con)
#queue processing loop
while True:
    #let the queue do what it needs
    pygame.fastevent.pump()
    #pull the next event
    ev = pygame.fastevent.poll()
    if ev.type == pygame.NOEVENT:
        #on an empty queue wait
        time.sleep(.2)
예제 #3
0
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()
	if ev.type == pygame.NOEVENT:
예제 #4
0
import time
import pygame
import string
import driverCode
#os.environ["SDL_VIDEODRIVER"] = 'dummy'
#init the pygame and display setup
pygame.init()
pygame.display.init()
screen = pygame.display.set_mode([800,600])
#init the queue
pygame.fastevent.init()
#init the joystick
js = pygame.joystick.Joystick(0)
js.init()
#start the connection
con = Connection()
#con.openConnection('192.168.0.100')
con.openConnection('127.0.0.1')
#start the timer
t=Timer()
t.startTimer()
#run the user init code
dc = driverCode.DriverCode(con)
#queue processing loop
while True:
	#let the queue do what it needs
	pygame.fastevent.pump()
	#pull the next event
	ev = pygame.fastevent.poll()
	if ev.type == pygame.NOEVENT:
		#on an empty queue wait