mirror of
https://github.com/node-red/node-red.git
synced 2025-12-28 07:41:42 +01:00
Updated ReadMe Raspberry Pi v2 (markdown)
@@ -41,7 +41,9 @@ Then copy the following flow and paste it into the Import Nodes dialog
|
||||
(*Import From - Clipboard* in the dropdown menu, or Ctrl-I). After clicking
|
||||
okay, click in the workspace to place the new nodes.
|
||||
|
||||
[{"id":"ae05f870.3bfc2","type":"function","name":"Toggle 0/1 on input","func":"\ncontext.state = context.state || 0;\n\n(context.state == 0) ? context.state = 1 : context.state = 0;\nmsg.payload = context.state;\n\nreturn msg;","outputs":1,"x":348.1666488647461,"y":146.16667652130127,"wires":\[\["1b0b73e9.14712c","b90e5005.a7c3b8"\]\]},{"id":"1b0b73e9.14712c","type":"debug","name":"","active":true,"complete":"false","x":587.1666488647461,"y":206.1666774749756,"wires":\[\]},{"id":"7aa75c69.fd5894","type":"inject","name":"tick every 1 sec","topic":"","payload":"","repeat":"1","crontab":"","once":false,"x":147.1666488647461,"y":146.1666774749756,"wires":\[\["ae05f870.3bfc2"\]\]},{"id":"b90e5005.a7c3b8","type":"rpi-gpio out","name":"","pin":"11","x":585.0000114440918,"y":146.00001049041748,"wires":\[\]}]
|
||||
```json
|
||||
[{"id":"ae05f870.3bfc2","type":"function","name":"Toggle 0/1 on input","func":"\ncontext.state = context.state || 0;\n\n(context.state == 0) ? context.state = 1 : context.state = 0;\nmsg.payload = context.state;\n\nreturn msg;","outputs":1,"x":348.1666488647461,"y":146.16667652130127,"wires":[["1b0b73e9.14712c","b90e5005.a7c3b8"]]},{"id":"1b0b73e9.14712c","type":"debug","name":"","active":true,"x":587.1666488647461,"y":206.1666774749756,"wires":[]},{"id":"7aa75c69.fd5894","type":"inject","name":"tick every 1 sec","topic":"","payload":"","repeat":"1","crontab":"","once":false,"x":147.1666488647461,"y":146.1666774749756,"wires":[["ae05f870.3bfc2"]]},{"id":"b90e5005.a7c3b8","type":"rpi-gpio out","name":"","pin":"7","x":585.0000114440918,"y":146.00001049041748,"wires":[]}]
|
||||
```
|
||||
|
||||
Click the deploy button and the flow should start running. The LED should start
|
||||
toggling on and off once a second.
|
||||
|
||||
Reference in New Issue
Block a user