Skip to content

Instantly share code, notes, and snippets.

@itechnotion
Last active August 3, 2018 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itechnotion/66bd8db942640059c3e935431141aece to your computer and use it in GitHub Desktop.
Save itechnotion/66bd8db942640059c3e935431141aece to your computer and use it in GitHub Desktop.
var spi = new SPI();
spi.setup({mosi:B15, miso:B14, sck:B10});
E.connectSDCard(spi, B1);
console.log(require("fs").readdirSync());
var w = new Waveform(128, {bits:16});
w.on("finish", function(buf) {
require("fs").writeFileSync("sound.raw",buf);
});
w.startInput(B0,2000,{repeat:false});
ar WIFI_NAME = "FiOS-7TC8E"; // Enter wifi name
var WIFI_OPTIONS = { password : "HermesTheKing369" }; // Enter wifi password
var wifi = require("Wifi");
wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
if (err) {
console.log("Connection error: "+err);
return;
}
console.log("Connected!");
getPage(); // Load http link for testing purpose
});
wifi.on('associated',function() { console.log("We're connected to an AP"); });
wifi.on('connected',function() { console.log("We have an IP Address"); });
wifi.on('disconnected',function() { console.log("We disconnected"); });
function getPage() {
require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
console.log("Response: ",res);
res.on('data', function(d) {
console.log("--->"+d);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment