var isOn = false;
var interval = 500;
function main() {
setInterval(function () {
isOn = !isOn;
digitalWrite(D2, isOn);
}, interval);
}
main();
it just won't do anything. My console says:
Found a prompt... great!
>>> Sending...
---> "\u0010reset();\n\u0010var isOn = false;\n\u0010var interval = 500;\n\u0010function main() {\u001b\n setInterval(function () {\u001b\n isOn = !isOn;\u001b\n digitalWrite(D2, isOn);\u001b\n }, interval);\u001b\n}\n\u0010main();\n\n"
Splitting at "reset();\n", delay 250
>>> Sent
but nothing appears to be blinking. When I try the WiFi example code:
var wifi = require("Wifi");
function onConnect(err) {
if(err) {
console.log("An error has occured :( ", err.message);
} else {
console.log("Connected with IP : ", wifi.getIP().ip);
}
}
wifi.connect("SSID", { password: "PASSWORD" }, onConnect);
It gives me a Module Wifi not found and the console says:
loadModule(Wifi)
ERROR: getURL("https://www.espruino.com/modules/Wifi.min.js") error : Not Found
ERROR: getURL("https://www.espruino.com/modules/Wifi.js") error : Not Found
WARNING: [notify_warn] Module Wifi not found
Found a prompt... great!
>>> Sending...
---> "\u0010reset();\n\u0010Modules.removeAllCached();\n\u0010var wifi = require(\"Wifi\");\n\u0010function onConnect(err) {\u001b\n if(err) {\u001b\n console.log(\"An error has occured :( \", err.message);\u001b\n } else {\u001b\n console.log(\"Connected with IP : \", wifi.getIP().ip);\u001b\n }\u001b\n}\n\u0010wifi.connect(\"SSID\", { password: \"PASSWORD\" }, onConnect);\n\n"
Splitting at "reset();\n", delay 250
>>> Sent
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I am trying to just get something to work using my ESP8266 NodeMCU. I purchased one of these but I simply can't get it to work.
I downloaded the 1v94 from the top of this page and extracted it to a folder. Then I ran this command:
and after flashing, I run the
esptool --port COM4 flash_id
command, which returns:But when I try to run some simple code like:
it just won't do anything. My console says:
but nothing appears to be blinking. When I try the WiFi example code:
It gives me a
Module Wifi not found
and the console says:What am I doing wrong here?