import Devices.mTaskDevice
import iTasks._Framework.Serialization
+count :: Main (ByteCode () Stmt)
+count = sds \x=0 In {main = x =. x +. lit 1 :. pub x :. noOp}
+
countAndLed :: Main (ByteCode () Stmt)
countAndLed = sds \x=1 In sds \pinnetje=1 In {main =
IF (digitalRead D3) (
ledtOff :: UserLED -> Main (ByteCode () Stmt)
ledtOff d = {main = ledOff (lit d) :. noOp}
+readDPin :: DigitalPin -> Main (ByteCode () Stmt)
+readDPin d = sds \pin=False In {main=pin =. digitalRead d :. noOp}
+
ledSelection :: Task UserLED
ledSelection = enterInformation "Select LED" []
+pinSelection :: Task DigitalPin
+pinSelection = enterInformation "Select digital pin" []
+
allmTasks :: Map String (Task (Main (ByteCode () Stmt)))
allmTasks = 'DM'.fromList
[("countAndLed", treturn countAndLed)
,("ledOn", ledSelection @ ledtOn)
,("ledOff", ledSelection @ ledtOff)
+ ,("readDPin", pinSelection @ readDPin)
,("blink", ledSelection @ blink)
,("blinkShare", treturn blinkShare)
+ ,("count", treturn count)
]