LEDs on Pi

A simple flow to show the control of on/off LEDs using the RasPiRobot V3 from Simon Monk

Note that the pins mentioned in Simon GITHUB are the BCM numbering not the pin numbering https://github.com/simonmonk/raspirobotboard3

[{"id":"54151c48.84d9d","type":"rpi-gpio out","z":"613d4fb4.88f42c","name":"LED 2 on BCM7","pin":"26","set":"","level":"0","out":"out","x":619,"y":139,"wires":[]},{"id":"67262d74.e69ca4","type":"inject","z":"613d4fb4.88f42c","name":"On","topic":"","payload":"1","payloadType":"string","repeat":"","crontab":"","once":false,"x":175,"y":137,"wires":[["2855ce7a.a07366","54151c48.84d9d"]]},{"id":"aefa65c0.bd4108","type":"inject","z":"613d4fb4.88f42c","name":"Off","topic":"","payload":"0","payloadType":"string","repeat":"","crontab":"","once":false,"x":186,"y":223,"wires":[["2855ce7a.a07366","54151c48.84d9d"]]},{"id":"26cab846.5c35ec","type":"rpi-gpio out","z":"613d4fb4.88f42c","name":"LED 1 on BCM8","pin":"24","set":"","level":"0","out":"out","x":620,"y":214,"wires":[]},{"id":"2855ce7a.a07366","type":"function","z":"613d4fb4.88f42c","name":"Invert","func":"if (msg.payload == 1) {\n    msg.payload = 0;\n}\nelse {\n    msg.payload = 1;\n    }\nreturn msg;","outputs":1,"noerr":0,"x":382,"y":244,"wires":[["26cab846.5c35ec"]]},{"id":"812b58d.34a6ee8","type":"comment","z":"613d4fb4.88f42c","name":"RRB3","info":"Demo controlling the LEDs on the RasPiRobot V3 from Simon Monk\n\n**Note** that the pins mentioned in Simon GITHUB are the BCM numbering not the pin numbering\nhttps://github.com/simonmonk/raspirobotboard3","x":191,"y":33,"wires":[]},{"id":"ee639ef3.4a33b","type":"comment","z":"613d4fb4.88f42c","name":"Pins","info":"    RIGHT_PWM_PIN = 14\n    RIGHT_1_PIN = 10\n    RIGHT_2_PIN = 25\n    LEFT_PWM_PIN = 24\n    LEFT_1_PIN = 17\n    LEFT_2_PIN = 4\n    SW1_PIN = 11\n    SW2_PIN = 9\n    LED1_PIN = 8\n    LED2_PIN = 7\n    OC1_PIN = 22\n    OC2_PIN = 27\n    OC2_PIN_R1 = 21\n    OC2_PIN_R2 = 27\n    TRIGGER_PIN = 18\n    ECHO_PIN = 23\n","x":368,"y":32,"wires":[]}]
Workshopshed

Flow Info

created 1 year, 1 month ago

Node Types

Core
  • comment (x2)
  • function (x1)
  • inject (x2)
  • rpi-gpio out (x2)

Tags

  • pi
  • LED
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option