関数の引数の代わりに値の宣言をキャストすると、異なる動作になるのはなぜですか?
次の操作がハングします。
let duration = uint32 500
...
brick.DirectCommand.TurnMotorAtPowerForTimeAsync(motors, power, duration, breakEnabled) |> ignore
次の操作は成功します。
brick.DirectCommand.TurnMotorAtPowerForTimeAsync(motors, power, uint32 500, breakEnabled) |> ignore
違いは何ですか?
コード:
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