From 5e7f2288699811b200e608dbfeaed2e487807d92 Mon Sep 17 00:00:00 2001 From: spirkelmann Date: Sun, 14 Apr 2019 22:23:34 +0200 Subject: [PATCH] adjusted display size for pygame --- micropython_firmware/remote_control.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/micropython_firmware/remote_control.py b/micropython_firmware/remote_control.py index ccfe3a8..cab279a 100644 --- a/micropython_firmware/remote_control.py +++ b/micropython_firmware/remote_control.py @@ -1,11 +1,15 @@ import socket import pygame -rc_socket = socket.socket() -rc_socket.connect(('192.168.4.1', 1234)) # connect to robot - pygame.init() -pygame.display.set_mode() +pygame.display.set_mode((640, 480)) + +rc_socket = socket.socket() +try: + rc_socket.connect(('192.168.4.1', 1234)) # connect to robot +except socket.error: + print("could not connect to socket") + while True: events = pygame.event.get()