Schemas / I/O

rig.sensor.gpio

v0.31.0 · draft 4 fields 2 required

Fields

FieldTypeMeaning
pin int required GPIO index
mode enumin · out required in, out
level number0 – 1 optional Optional. 0-1 reading or drive; absent = 0
device entity optional Optional board / network entity; absent or none = local

Digital hosts threshold level themselves (e.g. ≥ 0.5). A ROS 2 node entity is a valid device - docs/ros.md.

JSON Schema

Resolves at https://rig.works/schemas/rig.sensor.gpio.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.sensor.gpio.schema.json",
  "title": "rig.sensor.gpio",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "pin": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "mode": {
      "type": "string",
      "enum": [
        "in",
        "out"
      ]
    },
    "level": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "device": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    }
  },
  "required": [
    "pin",
    "mode"
  ]
}