Skip to content

Commit

Permalink
yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
townie committed Dec 9, 2016
1 parent 72b3144 commit 0742b98
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
var ledToggle, pressCount;
//provision the gpio pins 22 for the led output and 17 for the button input
var led= require("pi-pins").connect(22),
button = require("pi-pins").connect(17);
var led= require("pi-pins").connect(22);

//set the pin mode, setting pin 22 as an output and 17 as an input
button.mode('in');
led.mode('out');

//set the initial value of the LED to be off.
ledToggle = false;
pressCount= 0;
led.value(true);


function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

async function demo() {
async function demo(led) {
console.log('Taking a break...');
led.value(false);

Expand All @@ -27,4 +24,4 @@ async function demo() {
console.log('Two second later');
}

demo();
demole(led);

0 comments on commit 0742b98

Please sign in to comment.