Why does casting a value declaration instead of a function argument result in different behavior?
The following operation hangs:
let duration = uint32 500
...
brick.DirectCommand.TurnMotorAtPowerForTimeAsync(motors, power, duration, breakEnabled) |> ignore
The following operation succeeds:
brick.DirectCommand.TurnMotorAtPowerForTimeAsync(motors, power, uint32 500, breakEnabled) |> ignore
What's the difference?
Code:
let volume = 100
let frequency = uint16 1000
let duration = uint32 500
let power = 100
let motors = OutputPort.B ||| OutputPort.C
let breakEnabled = false
let moveAsync = async {
let brick = Brick(UsbCommunication())
brick.ConnectAsync() |> ignore
brick.DirectCommand.TurnMotorAtPowerForTimeAsync(motors, power, duration, breakEnabled) |> ignore
}
Async.RunSynchronously moveAsync