example.jl 731 Bytes
Newer Older
Anders Blomdell's avatar
Anders Blomdell committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()