package mindstorm

  1. Overview
  2. Docs
type t
type port = [
  1. | `S1
  2. | `S2
  3. | `S3
  4. | `S4
]
type sensor_type = [
  1. | `Angle
  2. | `Color_blue
  3. | `Color_full
  4. | `Color_green
  5. | `Color_none
  6. | `Color_red
  7. | `Custom
  8. | `Highspeed
  9. | `Light_active
  10. | `Light_inactive
  11. | `Lowspeed
  12. | `Lowspeed_9v
  13. | `No_sensor
  14. | `Reflection
  15. | `Sound_db
  16. | `Sound_dba
  17. | `Switch
  18. | `Temperature
]
type mode = [
  1. | `Angle_steps
  2. | `Bool
  3. | `Celsius
  4. | `Fahrenheit
  5. | `Pct_full_scale
  6. | `Period_counter
  7. | `Raw
  8. | `Slope_mask
  9. | `Transition_cnt
]
val set : ?check_status:bool -> 'a conn -> port -> sensor_type -> mode -> unit
type data = {
  1. sensor_type : sensor_type;
  2. mode : mode;
  3. valid : bool;
  4. raw : int;
  5. normalized : int;
  6. scaled : int;
}
val get : 'a conn -> port -> data
val color_of_data : data -> [ `Black | `Blue | `Green | `Red | `White | `Yellow ]
val reset_scaled : ?check_status:bool -> 'a conn -> port -> unit
val get_status : 'a conn -> port -> int
val write : ?check_status:bool -> 'a conn -> port -> ?rx_length:int -> string -> unit
val read : 'a conn -> port -> string
module Ultrasonic : sig ... end
OCaml

Innovation. Community. Security.