Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mTask
examples
Merge requests
!1
Interrupts example
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Interrupts example
interrupts
into
master
Overview
1
Commits
1
Pipelines
1
Changes
1
Merged
Ghost User
requested to merge
interrupts
into
master
3 years ago
Overview
1
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
dfc77986
1 commit,
3 years ago
1 file
+
26
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
switch.icl
0 → 100644
+
26
−
0
Options
module
switch
import
StdEnv
,
iTasks
import
mTask
.
Interpret
import
mTask
.
Interpret
.
Devices
Start
w
=
doTasks
main
w
main
::
Task
Bool
main
=
enterInformation
[]
>>?
\
spec
=:{
TCPSettings
|
host
,
port
}->
withDevice
spec
\
dev
->
liftmTask
switch
dev
switch
::
Main
(
MTask
v
Bool
)
|
mtask
v
switch
=
declarePin
D1
PMInput
\
d1
->
declarePin
D4
PMOutput
\
d4
->
fun
\
switch
=(\
x
->
(
writeD
d4
x
)
>>|.
delay
(
lit
50
)
// Debounce
>>|.
interrupt
Falling
d1
>>=.
(\_.
(
switch
(
Not
x
)))
)
In
{
main
=
switch
(
lit
False
)}
Loading