Add assignments to pins
[mTask.git] / Tasks / Examples.icl
index 2e2a973..4ca051d 100644 (file)
@@ -6,6 +6,11 @@ import mTask
 import Devices.mTaskDevice
 import iTasks._Framework.Serialization
 
+pinShare :: Main (ByteCode () Stmt)
+pinShare = sds \p=True In {main =
+               d0 =. p :. noOp
+       }
+
 faculty :: Int -> Main (ByteCode () Stmt)
 faculty i = sds \y=i In sds \x=1 In {main =
        IF (y <=. lit 1) (
@@ -15,16 +20,6 @@ faculty i = sds \y=i In sds \x=1 In {main =
                y =. y -. lit 1
        )}
 
-countTo5 :: Main (ByteCode () Stmt)
-countTo5 = sds \x=0 In {main =
-       x =. x +. lit 1 :.
-       pub x :.
-       IF ( x >. lit 5) (
-               retrn
-       ) (
-               noOp
-       )}
-
 count :: Main (ByteCode () Stmt)
 count = sds \x=0 In {main = x =. x +. lit 1 :. pub x :. noOp}
 
@@ -86,6 +81,6 @@ allmTasks = 'DM'.fromList
        ,("blink", ledSelection @ blink)
        ,("blinkShare", treturn blinkShare)
        ,("count", treturn count)
-       ,("countTo5", treturn countTo5)
        ,("faculty", enterInformation "Faculty" [] @ faculty)
+       ,("pinShare", treturn pinShare) 
        ]