Skip to content

Commit

Permalink
adding quick example how to control remotely
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Aug 10, 2023
1 parent edfcad0 commit 989211d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tools/fastapiSIM.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
import time
import os

'''
import requests
x = requests.get('http://localhost:8000/stopLoop')
print(x.text)
'''

try:
import RPi.GPIO as GPIO
except:
Expand All @@ -14,6 +20,20 @@

pygame.init()


import socket

def get_ip_address():
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
print(f"Hostname: {hostname}")
print(f"IP Address: {ip_address}")
print(f"Port: 80")
return ip_address

# Call the function to print the IP address
get_ip_address()

# Screen resolution
mResolution = [1920, 1080]
unitCellSize = 3
Expand Down Expand Up @@ -118,7 +138,7 @@ def generatePattern(inputNumber):
# Function to get image
def get_image(inputNumber: int):
global currentWavelength, surf, isGenerateImage
print(inputNumber)

display.blit(surf, (0, 0))
pygame.display.update()

Expand Down

0 comments on commit 989211d

Please sign in to comment.