Skip to content

Commit

Permalink
nimien vaihdot ja testiin stop juttu
Browse files Browse the repository at this point in the history
  • Loading branch information
ArttuKuikka committed Jan 7, 2024
1 parent 7bdc824 commit 88d673c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ def main(url, token):
red_button = Button(6, hold_time=0.05)
red_button.when_held = lambda: handle_button_press(url, token, 1)

light_red_button = Button(13, hold_time=0.05)
light_red_button.when_held = lambda: handle_button_press(url, token, 2)
orange_button = Button(13, hold_time=0.05)
orange_button.when_held = lambda: handle_button_press(url, token, 2)

light_green_button = Button(19, hold_time=0.05)
light_green_button.when_held = lambda: handle_button_press(url, token, 3)
yellow_button = Button(19, hold_time=0.05)
yellow_button.when_held = lambda: handle_button_press(url, token, 3)

green_button = Button(26, hold_time=0.05)
green_button.when_held = lambda: handle_button_press(url, token, 4)
Expand Down
16 changes: 10 additions & 6 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def do_GET(self):

if self.path.startswith("/led"):
changeLed(self.path)
elif self.path.startswith("/stop"):
exit()
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
Expand All @@ -51,10 +53,10 @@ def do_GET(self):
Punainen (taso1) = {taso1}
</h2>
<h2>
vaalean punainen (taso2) = {taso2}
oranssi (taso2) = {taso2}
</h2>
<h2>
vaalean vihreä (taso3) = {taso3}
keltainen (taso3) = {taso3}
</h2>
<h2>
vihreä (taso4) = {taso4}
Expand All @@ -63,6 +65,8 @@ def do_GET(self):
<button onclick="location.href = '/led?c=R';" id="myButton1" class="float-left submit-button" >LED RED</button>
<button onclick="location.href = '/led?c=G';" id="myButton1" class="float-left submit-button" >LED GREEN</button>
<button onclick="location.href = '/led?c=B';" id="myButton1" class="float-left submit-button" >LED BLUE</button>
<br>
<button onclick="location.href = '/stop';" id="myButton1" class="float-left submit-button" >STOP TEST</button>
""", "utf-8"))
Expand All @@ -74,11 +78,11 @@ def main(url, token):
red_button = Button(6, hold_time=0.05)
red_button.when_held = lambda: aanesta(url, token, 1)

light_red_button = Button(13, hold_time=0.05)
light_red_button.when_held = lambda: aanesta(url, token, 2)
orange_button = Button(13, hold_time=0.05)
orange_button.when_held = lambda: aanesta(url, token, 2)

light_green_button = Button(19, hold_time=0.05)
light_green_button.when_held = lambda: aanesta(url, token, 3)
yellow_button = Button(19, hold_time=0.05)
yellow_button.when_held = lambda: aanesta(url, token, 3)

green_button = Button(26, hold_time=0.05)
green_button.when_held = lambda: aanesta(url, token, 4)
Expand Down

0 comments on commit 88d673c

Please sign in to comment.