Browse Source

上传文件至 ''

Caner 3 years ago
parent
commit
37785d5b33
1 changed files with 13 additions and 0 deletions
  1. 13 0
      testGpio.js

+ 13 - 0
testGpio.js

@@ -0,0 +1,13 @@
+
+const RPIO = require("rpio");
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
+// prio init
+RPIO.init({ mapping: "gpio" });
+(async ()=>{
+// 继电器解锁
+RPIO.open(19, RPIO.OUTPUT, RPIO.HIGH);
+await sleep(2000)
+RPIO.open(6, RPIO.OUTPUT, RPIO.HIGH);
+await sleep(2000)
+RPIO.open(13, RPIO.OUTPUT, RPIO.HIGH);
+})()