|
|
@ -13,34 +13,24 @@ configuration = {
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
navigator = hardwarelib.Navigator(16)
|
|
|
|
navigator = hardwarelib.Navigator(16)
|
|
|
|
print('navigator created')
|
|
|
|
|
|
|
|
light = hardwarelib.Light(15)
|
|
|
|
light = hardwarelib.Light(15)
|
|
|
|
print('light created')
|
|
|
|
|
|
|
|
ultrasonic = hardwarelib.Ultrasonic(11,7)
|
|
|
|
ultrasonic = hardwarelib.Ultrasonic(11,7)
|
|
|
|
print('ultrasonic created')
|
|
|
|
|
|
|
|
temperature = hardwarelib.Temperature()
|
|
|
|
temperature = hardwarelib.Temperature()
|
|
|
|
print('temperature created')
|
|
|
|
|
|
|
|
camera = graphiclib.PiCamera((500, 0), (500, 1000))
|
|
|
|
camera = graphiclib.PiCamera((500, 0), (500, 1000))
|
|
|
|
print('camera created')
|
|
|
|
|
|
|
|
jstick = controllib.Joystick(navigator, light, configuration, camera)
|
|
|
|
jstick = controllib.Joystick(navigator, light, configuration, camera)
|
|
|
|
print('joystic created')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pygame stuff
|
|
|
|
#pygame stuff
|
|
|
|
screen = graphiclib.Screen(size=(1000,1000))
|
|
|
|
screen = graphiclib.Screen(size=(1000,1000))
|
|
|
|
print('created screen')
|
|
|
|
|
|
|
|
all_sprites = pygame.sprite.RenderUpdates()
|
|
|
|
all_sprites = pygame.sprite.RenderUpdates()
|
|
|
|
list = graphiclib.List((0,0),(500,1000))
|
|
|
|
list = graphiclib.List((0,0),(500,1000))
|
|
|
|
all_sprites.add(list)
|
|
|
|
all_sprites.add(list)
|
|
|
|
all_sprites.add(camera)
|
|
|
|
all_sprites.add(camera)
|
|
|
|
clock = pygame.time.Clock()
|
|
|
|
clock = pygame.time.Clock()
|
|
|
|
running = True
|
|
|
|
running = True
|
|
|
|
print('in running loop')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while running:
|
|
|
|
while running:
|
|
|
|
clock.tick(25)
|
|
|
|
clock.tick(25)
|
|
|
|
print('waited some time')
|
|
|
|
|
|
|
|
for event in pygame.event.get():
|
|
|
|
for event in pygame.event.get():
|
|
|
|
print(event)
|
|
|
|
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
print('quit event')
|
|
|
|
print('quit event')
|
|
|
|
running = False
|
|
|
|
running = False
|
|
|
@ -48,6 +38,7 @@ def main():
|
|
|
|
dict = jstick.handle()
|
|
|
|
dict = jstick.handle()
|
|
|
|
print('joystick handled')
|
|
|
|
print('joystick handled')
|
|
|
|
list.set_dict(dict)
|
|
|
|
list.set_dict(dict)
|
|
|
|
|
|
|
|
print('list has dict')
|
|
|
|
all_sprites.update()
|
|
|
|
all_sprites.update()
|
|
|
|
print('updating sprites')
|
|
|
|
print('updating sprites')
|
|
|
|
update_rects = all_sprites.draw(screen.screen)
|
|
|
|
update_rects = all_sprites.draw(screen.screen)
|
|
|
|