no I did paste the code to the right pane of the WebIDE. The following is what i am doing exactly...
Left pane right after startup of the WebIDE and connecting to my Espruino board
Right pane holds the slightly enhanced example code for the NRF24L01P module...
SPI1.setup({sck:A5, miso:A6, mosi:A7});
var nrf = require("NRF24L01P").connect(SPI1, B0, B1);
function onInit() {
print(nrf);
if (typeof nrf != "undefined") {
nrf.init([0,0,0,0,1], [0,0,0,0,2]);
print("NRF Library loaded!");
} else {
print("Error! NRF Library not loaded!");
}
}
onInit();
setInterval(function() {
nrf.slaveHandler();
}, 50);
After sending the code to the Espruino the following shows up in the left pane of the WebIDE:
>reset();
=undefined
_____ _
| __|___ ___ ___ _ _|_|___ ___
| __|_ -| . | _| | | | | . |
|_____|___| _|_| |___|_|_|_|___|
|_| http://www.espruino.com
1v47 Copyright 2014 Gordon Williams
-------------------------------------------
>echo(0);
ERROR: Function not found! Skipping. at line 1 col 32
var nrf = require("NRF24L01P").connect(SPI1, B0, B1);
^
undefined
Error! NRF Library not loaded!
=undefined
ERROR: Using '.' operator on non-object at line 2 col 8
nrf.slaveHandler();
^
at line 2 col 21
nrf.slaveHandler();
^
in function called from system
ERROR: Using '.' operator on non-object at line 2 col 8
nrf.slaveHandler();
^
at line 2 col 21
nrf.slaveHandler();
^
in function called from system
ERROR: Using '.' operator on non-object at line 2 col 8
nrf.slaveHandler();
^
at line 2 col 21
nrf.slaveHandler();
^
in function called from system
...
>clearInterval();
=undefined
>
When copying the code for the module from teh Espruino website into the Editor (right pane of the WebIDE) my Espruino also has problems to interpret the Javascript code. Maybe i should use the minified versions to check if it works?
Anyways, after clearing up all those inline '/..../' style comments the code did work last night, but i got some timing errors on the Espruino console (left pane in WebIDE). Maybe i can reproduce these again tomorrow if it helps.
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.
Hi Gordon,
no I did paste the code to the right pane of the WebIDE. The following is what i am doing exactly...
Left pane right after startup of the WebIDE and connecting to my Espruino board
Right pane holds the slightly enhanced example code for the NRF24L01P module...
After sending the code to the Espruino the following shows up in the left pane of the WebIDE:
When copying the code for the module from teh Espruino website into the Editor (right pane of the WebIDE) my Espruino also has problems to interpret the Javascript code. Maybe i should use the minified versions to check if it works?
Anyways, after clearing up all those inline '/..../' style comments the code did work last night, but i got some timing errors on the Espruino console (left pane in WebIDE). Maybe i can reproduce these again tomorrow if it helps.