Edited by peteroakes at Feb 20, 2016 00:34 |
I have node red running on Debian (Lemuntu) and am having trouble with getting Wiring PI to work correctly or any of the other modules that touch the GPIO pins
I have replaced the WiringPi sub folder in the node with the wiringLMK (renamed to wiringpi etc) and can get it to compile after patching and adding a few files
Is there a later version of wiringLMK that includes the missing parts from wiringPI to be compatable and upto date ?
If not does anyone else have a solution for node red to use the gpio from the designer.
I already know about using the "echo 50 > /sys/class/gpio/export" type of method using an exec block but I would prefer to either use the same as the raspberry pi nodes or the function block like the following
I am trying to review the board and wanted to show it with a nice industrial / home automation scenario but this is holding me from completing the work so any advice would be appreciated Copy the Code
- // select wpi pin on header (for v2)
- var pin = 7;
- // initialise the wpi to use the global context
- var wpi = context.global.wpi;
- // use the default WiringPi pin number scheme...
- wpi.wiringPiSetupPhys ();
- // initialise the state of the pin if not already set
- // anything in context. persists from one call to the function to the next
- context.state = context.state || wpi.LOW;
- // set the mode to output (just in case)
- wpi.pinMode(pin, OUTPUT);
- // toggle the stored state of the pin
- (context.state == wpi.LOW) ? context.state = wpi.HIGH : context.state = wpi.LOW;
- // output the state to the pin
- wpi.digitalWrite(pin, context.state);
- // we don't "need" to return anything here but may help for debug
- return msg;
Peter Oakes of the BreadBoard.