"When it's dark, turn on the light."
digitalWrite(LED1,1);
digitalWrite(LED1,0);
function toggle() {
on = !on;
digitalWrite(LED1, on);
};
toggle();
var interval = setInterval(toggle, 500);
clearInterval(interval);
LED1.set();
LED1.reset();
setWatch(function () {
LED1.set();
setTimeout("LED1.reset(); LED2.set();", 500);
setTimeout("LED2.reset(); LED3.set();", 1000);
setTimeout("LED3.reset()", 1500);
}, BTN, {
repeat : true,
edge : "rising"
});
var wlan = require("CC3000").connect();
var http = require("http");
wlan.connect("mySSID", "mySecret", function (s) {
if (s == "dhcp") {
console.log("My IP is " + wlan.getIP().ip);
http.get("http://www.pur3.co.uk/hello.txt", function(res) {
res.on('data', function(data) {
console.log(">" + data);
});
});
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello World');
res.end();
}).listen(80);
}
});
Allowing Espruino (Pico) to act like a USB keyboard, mouse or joystick.http://forum.espruino.com/conversations/127079/
Make your own input devices for you PC, or make Espruino "play back" a series of keypresses.