berijan

Motor and trigger

Apr 22nd, 2024
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. [
  2. {
  3. "id": "1025a6c72c0a9634",
  4. "type": "inject",
  5. "z": "bb65f54748035373",
  6. "name": "",
  7. "props": [
  8. {
  9. "p": "payload"
  10. },
  11. {
  12. "p": "topic",
  13. "vt": "str"
  14. }
  15. ],
  16. "repeat": "",
  17. "crontab": "",
  18. "once": false,
  19. "onceDelay": 0.1,
  20. "topic": "Trigger",
  21. "payload": "0",
  22. "payloadType": "num",
  23. "x": 140,
  24. "y": 120,
  25. "wires": [
  26. [
  27. "853d668cfa474099"
  28. ]
  29. ]
  30. },
  31. {
  32. "id": "9e446b51dbd95614",
  33. "type": "inject",
  34. "z": "bb65f54748035373",
  35. "name": "",
  36. "props": [
  37. {
  38. "p": "payload"
  39. },
  40. {
  41. "p": "topic",
  42. "vt": "str"
  43. }
  44. ],
  45. "repeat": "",
  46. "crontab": "",
  47. "once": false,
  48. "onceDelay": 0.1,
  49. "topic": "Trigger",
  50. "payload": "1",
  51. "payloadType": "num",
  52. "x": 140,
  53. "y": 160,
  54. "wires": [
  55. [
  56. "853d668cfa474099"
  57. ]
  58. ]
  59. },
  60. {
  61. "id": "415ca8e6501be4f0",
  62. "type": "inject",
  63. "z": "bb65f54748035373",
  64. "name": "",
  65. "props": [
  66. {
  67. "p": "payload"
  68. },
  69. {
  70. "p": "topic",
  71. "vt": "str"
  72. }
  73. ],
  74. "repeat": "",
  75. "crontab": "",
  76. "once": false,
  77. "onceDelay": 0.1,
  78. "topic": "MotA_forward",
  79. "payload": "0",
  80. "payloadType": "num",
  81. "x": 160,
  82. "y": 220,
  83. "wires": [
  84. [
  85. "853d668cfa474099"
  86. ]
  87. ]
  88. },
  89. {
  90. "id": "a9b25f996cd26753",
  91. "type": "inject",
  92. "z": "bb65f54748035373",
  93. "name": "",
  94. "props": [
  95. {
  96. "p": "payload"
  97. },
  98. {
  99. "p": "topic",
  100. "vt": "str"
  101. }
  102. ],
  103. "repeat": "",
  104. "crontab": "",
  105. "once": false,
  106. "onceDelay": 0.1,
  107. "topic": "MotA_forward",
  108. "payload": "1",
  109. "payloadType": "num",
  110. "x": 160,
  111. "y": 260,
  112. "wires": [
  113. [
  114. "853d668cfa474099"
  115. ]
  116. ]
  117. },
  118. {
  119. "id": "853d668cfa474099",
  120. "type": "join",
  121. "z": "bb65f54748035373",
  122. "name": "join 2 topics",
  123. "mode": "custom",
  124. "build": "object",
  125. "property": "payload",
  126. "propertyType": "msg",
  127. "key": "topic",
  128. "joiner": "\\n",
  129. "joinerType": "str",
  130. "accumulate": true,
  131. "timeout": "",
  132. "count": "2",
  133. "reduceRight": false,
  134. "reduceExp": "",
  135. "reduceInit": "",
  136. "reduceInitType": "",
  137. "reduceFixup": "",
  138. "x": 400,
  139. "y": 180,
  140. "wires": [
  141. [
  142. "16f12f3d1b04c7c1",
  143. "303722339fe484f4"
  144. ]
  145. ]
  146. },
  147. {
  148. "id": "16f12f3d1b04c7c1",
  149. "type": "debug",
  150. "z": "bb65f54748035373",
  151. "name": "debug 1",
  152. "active": true,
  153. "tosidebar": true,
  154. "console": false,
  155. "tostatus": false,
  156. "complete": "payload",
  157. "targetType": "msg",
  158. "statusVal": "",
  159. "statusType": "auto",
  160. "x": 600,
  161. "y": 240,
  162. "wires": []
  163. },
  164. {
  165. "id": "303722339fe484f4",
  166. "type": "function",
  167. "z": "bb65f54748035373",
  168. "name": "function 5",
  169. "func": "let on = 0;\n\nif (msg.payload.Trigger === 1 && msg.payload.MotA_forward === 1)\n{\n on = 1;\n}\n\n\nlet msg1 = {payload : on};\nlet msg2 = {payload : 0};\n\nreturn [[msg1],[msg2]];",
  170. "outputs": 2,
  171. "timeout": 0,
  172. "noerr": 0,
  173. "initialize": "",
  174. "finalize": "",
  175. "libs": [],
  176. "x": 600,
  177. "y": 180,
  178. "wires": [
  179. [
  180. "0bd5b7acec175e62"
  181. ],
  182. [
  183. "ae32c4e99bc7b601"
  184. ]
  185. ]
  186. },
  187. {
  188. "id": "0bd5b7acec175e62",
  189. "type": "debug",
  190. "z": "bb65f54748035373",
  191. "name": "debug 2",
  192. "active": true,
  193. "tosidebar": true,
  194. "console": false,
  195. "tostatus": false,
  196. "complete": "false",
  197. "statusVal": "",
  198. "statusType": "auto",
  199. "x": 800,
  200. "y": 160,
  201. "wires": []
  202. },
  203. {
  204. "id": "ae32c4e99bc7b601",
  205. "type": "debug",
  206. "z": "bb65f54748035373",
  207. "name": "debug 3",
  208. "active": true,
  209. "tosidebar": true,
  210. "console": false,
  211. "tostatus": false,
  212. "complete": "false",
  213. "statusVal": "",
  214. "statusType": "auto",
  215. "x": 800,
  216. "y": 200,
  217. "wires": []
  218. }
  219. ]
Tags: nodered
Advertisement
Add Comment
Please, Sign In to add comment