1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #133 from cpswan/master

Enable Pi to use of all 17 WiringPi pins
This commit is contained in:
Dave Conway-Jones 2014-01-13 12:04:31 -08:00
commit 08559838cc
2 changed files with 40 additions and 4 deletions

View File

@ -19,14 +19,23 @@
<label for="node-input-pin"><i class="icon-asterisk"></i> GPIO Pin</label>
<select type="text" id="node-input-pin" style="width: 150px;">
<option value="-">select pin</option>
<option value="3">3</option>
<option value="5">5</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="26">26</option>
</select>
</div>
<div class="form-row">
@ -81,14 +90,23 @@
<label for="node-input-pin"><i class="icon-asterisk"></i> GPIO Pin</label>
<select type="text" id="node-input-pin" style="width: 150px;">
<option value="-">select pin</option>
<option value="3">3</option>
<option value="5">5</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="26">26</option>
</select>
</div>
<div class="form-row">

View File

@ -32,25 +32,43 @@ if (!fs.existsSync("/usr/local/bin/gpio")) {
// Map physical P1 pins to Gordon's Wiring-Pi Pins (as they should be V1/V2 tolerant)
var pintable = {
// Physical : WiringPi
"7":"7",
"11":"0",
"12":"1",
"13":"2",
"15":"3",
"16":"4",
"18":"5",
"22":"6"
"22":"6",
"7":"7",
"3":"8",
"5":"9",
"24":"10",
"26":"11",
"19":"12",
"21":"13",
"23":"14",
"8":"15",
"10":"16"
}
var tablepin = {
// WiringPi : Physical
"7":"7",
"0":"11",
"1":"12",
"2":"13",
"3":"15",
"4":"16",
"5":"18",
"6":"22"
"6":"22",
"7":"7",
"8":"3",
"9":"5",
"10":"24",
"11":"26",
"12":"19",
"13":"21",
"14":"23",
"15":"8",
"16":"10"
}
function GPIOInNode(n) {