Hi folks
I'm trying to make up a quiz style buzzer system where a sound is played when the button is pressed but prevents other button presses.
I've got my two buttons setup but cant work out how to get one to disable if the other is pressed.
[
{
"id": "f6d6e6ecc2f1ff85",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "202817796aaaf732",
"type": "rpi-gpio in",
"z": "f6d6e6ecc2f1ff85",
"name": "REDBTN",
"pin": "21",
"intype": "up",
"debounce": "25",
"read": true,
"bcm": true,
"x": 180,
"y": 200,
"wires": [
[
"1053f18b1a393fcb"
]
]
},
{
"id": "c99b13c1e7a0fd26",
"type": "rpi-gpio out",
"z": "f6d6e6ecc2f1ff85",
"name": "REDLED",
"pin": "26",
"set": true,
"level": "0",
"freq": "",
"out": "out",
"bcm": true,
"x": 960,
"y": 160,
"wires": []
},
{
"id": "f79568c50c5e417d",
"type": "change",
"z": "f6d6e6ecc2f1ff85",
"name": "Set to 0",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 740,
"y": 160,
"wires": [
[
"c99b13c1e7a0fd26"
]
]
},
{
"id": "2e2829f09a72e129",
"type": "change",
"z": "f6d6e6ecc2f1ff85",
"name": "Set to ON",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 600,
"y": 220,
"wires": [
[
"c99b13c1e7a0fd26",
"c0891937af14f87f"
]
]
},
{
"id": "1053f18b1a393fcb",
"type": "switch",
"z": "f6d6e6ecc2f1ff85",
"name": "IF Red ON",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 350,
"y": 200,
"wires": [
[
"453ca014b3b76015"
],
[
"2e2829f09a72e129"
]
]
},
{
"id": "453ca014b3b76015",
"type": "delay",
"z": "f6d6e6ecc2f1ff85",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 600,
"y": 160,
"wires": [
[
"f79568c50c5e417d"
]
]
},
{
"id": "c0891937af14f87f",
"type": "play-soundfile",
"z": "f6d6e6ecc2f1ff85",
"name": "buzz1",
"directory": "9d49b6ae2f29f2cc",
"file": "buzz1.wav",
"allow_multiple": false,
"x": 850,
"y": 220,
"wires": [
[]
]
},
{
"id": "8eb3eb470038aef7",
"type": "rpi-gpio in",
"z": "f6d6e6ecc2f1ff85",
"name": "GREENBTN",
"pin": "20",
"intype": "up",
"debounce": "25",
"read": true,
"bcm": true,
"x": 170,
"y": 460,
"wires": [
[
"eac718ea4c87047b"
]
]
},
{
"id": "d29784b408c3fa24",
"type": "rpi-gpio out",
"z": "f6d6e6ecc2f1ff85",
"name": "GREENLED",
"pin": "19",
"set": true,
"level": "0",
"freq": "",
"out": "out",
"bcm": true,
"x": 880,
"y": 440,
"wires": []
},
{
"id": "367ca66b4945b6ef",
"type": "change",
"z": "f6d6e6ecc2f1ff85",
"name": "Set to 0",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 440,
"wires": [
[
"d29784b408c3fa24"
]
]
},
{
"id": "a683fdad6920c54f",
"type": "change",
"z": "f6d6e6ecc2f1ff85",
"name": "Set to ON",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 500,
"wires": [
[
"d29784b408c3fa24",
"4065e45352cdbd1e"
]
]
},
{
"id": "eac718ea4c87047b",
"type": "switch",
"z": "f6d6e6ecc2f1ff85",
"name": "IF Green ON",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 340,
"y": 460,
"wires": [
[
"81a7a03910acb789"
],
[
"a683fdad6920c54f"
]
]
},
{
"id": "81a7a03910acb789",
"type": "delay",
"z": "f6d6e6ecc2f1ff85",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 510,
"y": 440,
"wires": [
[
"367ca66b4945b6ef"
]
]
},
{
"id": "4065e45352cdbd1e",
"type": "play-soundfile",
"z": "f6d6e6ecc2f1ff85",
"name": "buzz2",
"directory": "9d49b6ae2f29f2cc",
"file": "buzz2.wav",
"allow_multiple": false,
"x": 760,
"y": 500,
"wires": [
[]
]
},
{
"id": "9d49b6ae2f29f2cc",
"type": "soundfile-directory",
"directory": "/home/pi/buzzer/Sounds"
}
]