From b6b684af25ea11a3fb3c1c2a539c56c2c06687f7 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Thu, 25 Jul 2019 00:00:13 +0200 Subject: [PATCH] Fix wrong status code displaying. Uncomment GPIO lines in the signaler. --- morse/lib/morse_signaler.ex | 6 +++--- ui/lib/ui_web/templates/page/morse.html.eex | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/morse/lib/morse_signaler.ex b/morse/lib/morse_signaler.ex index 3326858..0137773 100644 --- a/morse/lib/morse_signaler.ex +++ b/morse/lib/morse_signaler.ex @@ -20,10 +20,10 @@ defmodule MorseSignaler do """ def signal(server_pid) do - # {:ok, gpio} = GPIO.open(relay_pin(), :output) - # GPIO.write(gpio, @off) + {:ok, gpio} = GPIO.open(relay_pin(), :output) + GPIO.write(gpio, @off) Process.sleep(@sleep_start) - # signal_sentence(gpio, String.graphemes(secret_code())) + signal_sentence(gpio, String.graphemes(secret_code())) GenServer.cast(server_pid, :done) :ok diff --git a/ui/lib/ui_web/templates/page/morse.html.eex b/ui/lib/ui_web/templates/page/morse.html.eex index bac0db5..42c2d47 100644 --- a/ui/lib/ui_web/templates/page/morse.html.eex +++ b/ui/lib/ui_web/templates/page/morse.html.eex @@ -33,9 +33,6 @@ responseP.innerHTML = "Starting..."; xhttp.open("GET", "/start", true); xhttp.send(); - setTimeout(function() { - responseP.innerHTML = "Started."; - }, 3000); } function givehint() {