From b169f96a7bf783e43fc08bc0ad2aef3a5dfe7cbe Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 22 Mar 2019 15:24:37 +0100 Subject: [PATCH] Bling bling --- RELEASE_NOTES.md | 2 +- src/PiServer/PiServer.fs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f5b7e8a..ee1ac4d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,6 @@ # Release Notes -## 1.3.0 - 2019-03-21 +## 1.3.1 - 2019-03-22 * Show light ## 1.2.1 - 2019-03-19 diff --git a/src/PiServer/PiServer.fs b/src/PiServer/PiServer.fs index ef0cec4..51f4b2e 100644 --- a/src/PiServer/PiServer.fs +++ b/src/PiServer/PiServer.fs @@ -81,7 +81,8 @@ let rfidLoop (dispatch,nodeServices:INodeServices) = task { let yellowLight = GeneralIO.LED(Unosquare.RaspberryIO.Pi.Gpio.[BcmPin.Gpio21]) let allLights = [| blueLight; yellowLight|] - let! _ = allLights |> Array.map (fun l -> l.Blink(10)) |> Task.WhenAll + let! _ = allLights |> Array.map (fun l -> l.Blink(2)) |> Task.WhenAll + log.InfoFormat("Waiting for RFID cards or NFC tags...") while true do let! token = nodeServices.InvokeExportAsync("./read-tag", "read", "tag") @@ -90,6 +91,7 @@ let rfidLoop (dispatch,nodeServices:INodeServices) = task { let! _ = Task.Delay(TimeSpan.FromSeconds 0.5) () else + let! _ = allLights |> Array.map (fun l -> l.Blink(2)) |> Task.WhenAll dispatch (NewRFID token) let mutable waiting = true while waiting do @@ -101,6 +103,7 @@ let rfidLoop (dispatch,nodeServices:INodeServices) = task { let! _ = Task.Delay(TimeSpan.FromSeconds 2.) let! newToken = nodeServices.InvokeExportAsync("./read-tag", "read", "tag") if newToken <> token then + let! _ = allLights |> Array.map (fun l -> l.Blink(2)) |> Task.WhenAll dispatch RFIDRemoved waiting <- false } @@ -229,7 +232,7 @@ let update (msg:Msg) (model:Model) = let mediaFile : MediaFile = { FileName = url } - model, Cmd.batch [Cmd.ofMsg (Play mediaFile) ] + model, Cmd.batch [Cmd.ofMsg (Play mediaFile) ] | Err exn -> log.ErrorFormat("Error: {0}", exn.Message) model, Cmd.none