Add pico display feedback

This commit is contained in:
2026-03-28 12:53:28 +01:00
parent 4da779a125
commit 0bd11e7f3b
4 changed files with 245 additions and 31 deletions

View File

@@ -39,20 +39,25 @@ def wifi_connect(SSID:str, PASSWORD:str) -> None:
# send a HTTP-request to the access point with the rate value
def send_request(user_id:int, rating:int) -> None:
def send_request(user_id:int, rating:int) -> bool:
# create HTTP-URL
URL = f"http://{IP_ADRESS_SERVER}:{str(SERVER_PORT)}/ratings/{user_id}/{rating}"
print(URL)
# create request
response = urequests.get(URL)
try:
# create request
response = urequests.get(URL)
# print HTTP-answer of the access point
print("Server response:")
print(response.text)
print()
response.close()
# print HTTP-answer of the access point
print("Server response:")
print(response.text)
print()
response.close()
return True
except Exception as e:
print(f"Request failed: {e}")
return False
# test, if there can be a connection to the given ip adress and port