package serial
Serial communication module
Install
Dune Dependency
Authors
Maintainers
Sources
0.0.1.tar.gz
md5=c18e5153f7dac89c4aea47d929cf9310
sha512=619ae1cd862a905a9114902cdad06010e85482087741e674b9079edbe33fc691aff5e5fb7f78ec667bd558f4332d3d5181a58674d367288d877ede13e1387327
README.md.html
OSerial
OCaml Serial Module
Installation
opam install serial
Usage
Create a Serial_config module
module Serial_config = struct
let port = "/dev/ttyUSB0"
end
Open the port
module Serial0 = Serial.Make(Serial_config)
Supplied Functions The function returns are wrapped in Lwt.t
, so please read up on Lwt should you be unfamiliar with the library.
read_line : unit -> string Lwt.t
write_line : string -> unit Lwt.t
wait_for_line : string -> unit Lwt.t
Usage: wait_for_line "READY"
. Currently waits forever if the keyword is not received.
io_loop : string option -> unit Lwt.t
Opens a two-way communication channel between stdin and the serial device. Usage: io_loop (Some "quit")
. If None
is supplied instead, does not exit for any keyword.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>