X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTask.dcl;h=ac9405c0544dc3c916dece2b63203c7e373a3961;hb=acd239b3f29e215ade0b63d5b26b6cf8e8ae0d63;hp=c7a6a3ae001ee549d93f681e4cd8b7656b7f77de;hpb=1c8014ff74afb966b891a4689d8ee3e512300746;p=mTask.git diff --git a/mTask.dcl b/mTask.dcl index c7a6a3a..ac9405c 100644 --- a/mTask.dcl +++ b/mTask.dcl @@ -14,12 +14,15 @@ todo: imporove setp: >>*. */ +import Generics.gCons +import Generics.gdynamic + import iTasks import iTasks._Framework.Generic from iTasks._Framework.Task import :: Task import StdClass -import gdynamic, gCons, GenEq, StdMisc, StdArray +import GenEq, StdMisc, StdArray import mTaskCode, mTaskSimulation, mTaskInterpret import mTaskSerial, mTaskLCD @@ -32,6 +35,7 @@ import mTaskSerial, mTaskLCD :: DigitalPin = D0 | D1 | D2 | D3 | D4 | D5 |D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 :: AnalogPin = A0 | A1 | A2 | A3 | A4 | A5 +:: UserLED = LED1 | LED2 | LED3 :: PinMode = INPUT | OUTPUT | INPUT_PULLUP :: Pin = Digital DigitalPin | Analog AnalogPin @@ -127,6 +131,10 @@ class time v where delay :: (v Long p) -> (v Long Expr) millis :: (v Long Expr) +class userLed v where + ledOn :: UserLED -> (v () Stmt) + ledOff :: UserLED -> (v () Stmt) + class pio p t where pio :: p -> v t Upd | aIO v & dIO v instance pio AnalogPin Int instance pio AnalogPin Bool