Skip to content

Instantly share code, notes, and snippets.

@redaphid
Created July 21, 2015 23:35
Show Gist options
  • Save redaphid/5dc1830a0318c0632e60 to your computer and use it in GitHub Desktop.
Save redaphid/5dc1830a0318c0632e60 to your computer and use it in GitHub Desktop.
The Tentacle Message Formats
{
"options": {
"port" : "/dev/tty.usbmodem14110000.1",
"broadcastPins" : true,
"broadcastInterval": 2500,
"pins": [
{"action" : "digitalWrite", "number" : 7},
{"action" : "analogRead", "number" : 15}
]
}
}
{
"type": "object",
"required": [
"pins"
],
"properties": {
"pins": {
"title": "Pin Configuration",
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"number": {
"title": "Number",
"type": "integer",
"minimum": 0
},
"action": {
"title": "Action",
"type": "string",
"enum": [
"digitalRead" ,
"digitalWrite" ,
"analogRead",
"analogWrite",
"servoWrite",
"pwmWrite",
"i2cWrite",
"i2cRead",
"ignore"
]
}
},
"required": [
"number",
"action"
]
}
},
"broadcastPins" : {
"title" : "Broadcast Pins?",
"type": "boolean",
"default": false
},
"broadcastInterval" : {
"title" : "Broadcast Interval (ms)",
"type" : "number",
"default" : 2000,
"minimum": 15
}
}
}
{
"devices": "ff12c403-04c7-4e63-9073-2e3b1f8e4450",
"payload": {
"pins": [
{ "action" : "analogRead", "number": 16},
{ "action" : "digitalWrite", "number": 13, "value": 1},
]
}
}
{
"type": "object",
"required": [
"pins"
],
"properties": {
"customData" : {
"type": "string"
},
"pins": {
"title": "Pin Configuration",
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"number": {
"title": "Number",
"type": "integer",
"minimum": 0,
"default": 13
},
"action": {
"title": "Action",
"type": "string",
"enum": [
"digitalRead" ,
"digitalWrite" ,
"analogRead",
"analogWrite",
"servoWrite",
"pwmWrite",
"i2cWrite",
"i2cRead"
]
},
"value": {
"type": "integer",
"default": 1
}
},
"required": [
"number",
"action"
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment