Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mattias Fält
moberg
Commits
36b9204d
Commit
36b9204d
authored
May 16, 2019
by
Anders Blomdell
Browse files
Add julia example
parent
ba77f396
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/example.jl
0 → 100644
View file @
36b9204d
import
MobergIO
using
MobergIO
:
read
,
write
function
scan
()
result
=
[[],
[],
[],
[],
[]]
m
=
MobergIO
.
Moberg
()
for
(
i
,
f
)
=
enumerate
([
MobergIO
.
AnalogIn
,
MobergIO
.
AnalogOut
,
MobergIO
.
DigitalIn
,
MobergIO
.
DigitalOut
,
MobergIO
.
EncoderIn
])
for
j
in
range
(
0
,
stop
=
100
)
try
push!
(
result
[
i
],
((
j
,
f
(
m
,
Unsigned
(
j
)))))
catch
ex
end
end
end
result
end
function
main
()
channels
=
scan
()
for
c
=
channels
println
(
length
(
c
))
end
for
c
=
channels
[
2
]
println
(
"
$
(c[1])
$
(write(c[2], Inf)),
$
(write(c[2], -Inf)),
$
(write(c[2], 0.0))"
)
end
end
main
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment