diff --git a/src/declarative/components/input/PIRMotionSensor.tsx b/src/declarative/components/input/PIRMotionSensor.tsx index 6babbc1..f75b992 100644 --- a/src/declarative/components/input/PIRMotionSensor.tsx +++ b/src/declarative/components/input/PIRMotionSensor.tsx @@ -22,12 +22,12 @@ export const PIRMotionSensor: React.FC = ({ const setupPIRMotionSensor = async (port: SerialPort) => { const pirMotionSensor = attachInput(port, pin) - if (triggered) { - pirMotionSensor.read('off', triggered) + if (untriggered) { + pirMotionSensor.read('off', untriggered) } - if (untriggered) { - pirMotionSensor.read('on', untriggered) + if (triggered) { + pirMotionSensor.read('on', triggered) } } diff --git a/src/declarative/components/input/PhotoInterrupter.tsx b/src/declarative/components/input/PhotoInterrupter.tsx index 942cbb4..e543e16 100644 --- a/src/declarative/components/input/PhotoInterrupter.tsx +++ b/src/declarative/components/input/PhotoInterrupter.tsx @@ -21,12 +21,12 @@ export const PhotoInterrupter: React.FC = ({ const setupPhotoInterrupter = (port: SerialPort) => { const photointerrupter = attachInput(port, pin) - if (triggered) { - photointerrupter.read('off', triggered) + if (untriggered) { + photointerrupter.read('off', untriggered) } - if (untriggered) { - photointerrupter.read('on', untriggered) + if (triggered) { + photointerrupter.read('on', triggered) } }