Created
February 11, 2016 23:05
-
-
Save ShawnHymel/81b642dcedd7b7266837 to your computer and use it in GitHub Desktop.
Getting Started with Intel Edison - Part 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mraa = require('mraa'); | |
var http = require('http'); | |
var port = 4242; | |
var led = new mraa.Gpio(12, true, true); | |
led.dir(mraa.DIR_OUT); | |
var server = http.createServer(function(req, res) { | |
res.writeHead(200); | |
res.write(" <!DOCTYPE html> \ | |
<html> \ | |
<head> \ | |
<title>My Page</title> \ | |
</head> \ | |
<body> \ | |
<p>This is my page. There are many like it.</p> \ | |
</body> \ | |
</html>"); | |
res.end(); | |
led.write(1); | |
setTimeout(function() { | |
led.write(0); | |
}, 500); | |
}); | |
server.listen(port, function() { | |
console.log('Server listening on port ' + port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment