4 import mTask.Interpret.Device.TCP
5 import iTasks.Extensions.DateTime
8 Start w = doTasks interactiveBlink w
10 interactiveBlink :: Task ()
11 interactiveBlink = enterDevice/*\label{lst:intro_enterDevice}*/
12 >>? \spec->withShared 500 \iInterval-> /*\label{lst:intro_withshared}*/
13 withDevice spec \dev-> /*\label{lst:intro_withdevice}*/
14 liftmTask (intBlink iInterval) dev/*\label{lst:intro_liftmtask}*/
15 -|| (Hint "Interval (ms)" @>> updateSharedInformation [] iInterval)/*\label{lst:intro_editor}*/
16 >>* [OnAction (Action "Stop") (always (return ()))]
18 enterDevice :: Task TCPSettings
19 enterDevice = enterInformation [] <<@ Hint "Enter connection info"
21 intBlink :: (Shared sds Int) -> Main (MTask v Int)
22 | mtask, lowerSds v & RWShared sds & TC sds () Int Int
24 intBlink :: (Shared sds Int) -> Main (MTask v Int) | mtask v & ...
27 declarePin D2 PMOutput \ledPin-> /*\label{lst:intro:declarePin}*/
28 lowerSds \mInterval = iInterval/*\label{lst:intro:liftsds}*/
29 In fun \blink = (\st-> /*\label{lst:intro:blink_fro}*/
33 >>|. blink (Not st))/*\label{lst:intro:blink_to}*/
34 In {main = blink true}/*\label{lst:intro:mtask_to}*/