199 lines
3.5 KiB
JSON
199 lines
3.5 KiB
JSON
{
|
|
"kind": "sequence",
|
|
"name": "Test Sequence (TM)",
|
|
"color": "red",
|
|
"id": 2,
|
|
"comment": "This is the root",
|
|
"args": {
|
|
"version": 20180209,
|
|
"locals": {
|
|
"kind": "scope_declaration",
|
|
"args": {}
|
|
}
|
|
},
|
|
"body": [
|
|
{
|
|
"kind": "move_absolute",
|
|
"args": {
|
|
"speed": 100,
|
|
"offset": {
|
|
"kind": "coordinate",
|
|
"args": {
|
|
"y": 20,
|
|
"x": 10,
|
|
"z": -30
|
|
}
|
|
},
|
|
"location": {
|
|
"kind": "point",
|
|
"args": {
|
|
"pointer_type": "Plant",
|
|
"pointer_id": 1
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "move_relative",
|
|
"args": {
|
|
"x": 10,
|
|
"y": 20,
|
|
"z": 30,
|
|
"speed": 50
|
|
},
|
|
"comment": "Slow move"
|
|
},
|
|
{
|
|
"kind": "write_pin",
|
|
"args": {
|
|
"pin_number": 0,
|
|
"pin_value": 0,
|
|
"pin_mode": 0
|
|
}
|
|
},
|
|
{
|
|
"kind": "write_pin",
|
|
"args": {
|
|
"pin_mode": 0,
|
|
"pin_value": 1,
|
|
"pin_number": {
|
|
"kind": "named_pin",
|
|
"args": {
|
|
"pin_type": "Peripheral",
|
|
"pin_id": 5
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "read_pin",
|
|
"args": {
|
|
"pin_mode": 0,
|
|
"label": "---",
|
|
"pin_number": 0
|
|
}
|
|
},
|
|
{
|
|
"kind": "read_pin",
|
|
"args": {
|
|
"pin_mode": 1,
|
|
"label": "---",
|
|
"pin_number": {
|
|
"kind": "named_pin",
|
|
"args": {
|
|
"pin_type": "Sensor",
|
|
"pin_id": 1
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "wait",
|
|
"args": {
|
|
"milliseconds": 100
|
|
}
|
|
},
|
|
{
|
|
"kind": "send_message",
|
|
"args": {
|
|
"message": "FarmBot is at position {{ x }}, {{ y }}, {{ z }}.",
|
|
"message_type": "success"
|
|
},
|
|
"body": [
|
|
{
|
|
"kind": "channel",
|
|
"args": {
|
|
"channel_name": "toast"
|
|
}
|
|
},
|
|
{
|
|
"kind": "channel",
|
|
"args": {
|
|
"channel_name": "email"
|
|
}
|
|
},
|
|
{
|
|
"kind": "channel",
|
|
"args": {
|
|
"channel_name": "espeak"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"kind": "find_home",
|
|
"args": {
|
|
"speed": 100,
|
|
"axis": "all"
|
|
}
|
|
},
|
|
{
|
|
"kind": "_if",
|
|
"args": {
|
|
"rhs": 0,
|
|
"op": "is_undefined",
|
|
"lhs": "x",
|
|
"_then": {
|
|
"kind": "execute",
|
|
"args": {
|
|
"sequence_id": 1
|
|
}
|
|
},
|
|
"_else": {
|
|
"kind": "nothing",
|
|
"args": {}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "_if",
|
|
"args": {
|
|
"rhs": 500,
|
|
"op": ">",
|
|
"_then": {
|
|
"kind": "nothing",
|
|
"args": {}
|
|
},
|
|
"_else": {
|
|
"kind": "execute",
|
|
"args": {
|
|
"sequence_id": 1
|
|
}
|
|
},
|
|
"lhs": {
|
|
"kind": "named_pin",
|
|
"args": {
|
|
"pin_type": "Sensor",
|
|
"pin_id": 2
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"kind": "execute",
|
|
"args": {
|
|
"sequence_id": 1
|
|
}
|
|
},
|
|
{
|
|
"kind": "execute_script",
|
|
"args": {
|
|
"label": "plant-detection"
|
|
},
|
|
"body": [
|
|
{
|
|
"kind": "pair",
|
|
"args": {
|
|
"value": 0,
|
|
"label": "plant_detection_input"
|
|
},
|
|
"comment": "Input"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"kind": "take_photo",
|
|
"args": {}
|
|
}
|
|
]
|
|
} |