Hello, I have two IskraJS boards(http://wiki.amperka.ru/js:iskra_js – ISKRAJS on the Amperka website) and IskraJSmini(http://wiki.amperka.ru/продукты:iskra-js-mini – ISKGAJSMIN on the amperka website) and two NRF24l01+ wireless communication modules. I connected the modules to the boards directly using an auxiliary pinout scheme from the sites above and to the module itself to the available SPI interfaces (without IRQ contact):
MISO – MISO;
MOSI – MOSI;
SCK – SCK;
CSN – CSN;
CE- CE;
Vcc – 3.3V;
GND – GND.
I used the instructions from the website(http://www.espruino.com/NRF24L01P - description of the connection NRF24l01+ to work via EspruinoIDE), as I understood there was no IRQ connection required, well, I did not connect it…
In the code for the Iskra JS board, which became the emitter (Master), I prescribed again as from the example (only for the necessary contacts):
SPI2.setup({sck:B13, miso:B14, mosi:B15});
var nrf = require("NRF24L01P").connect( SPI2, B0, B1 ); //B0(P6),B1(P5) на схеме
function onInit() {
nrf.init([0,0,0,0,2], [0,0,0,0,1]);
}
onInit();
setInterval(function() {
nrf.masterHandler();
}, 50);
And I didn't do anything else – but it is filled into memory every other time (the console falls out when filling the firmware).
In the code for the Iskra JS mini board, which I have become a receiver (Slave), I prescribed and filled in (the console worked fine in the Espruino ide):
SPI1.setup({sck:A5, miso:A6, mosi:A7});
var nrf = require("NRF24L01P").connect( SPI1, B0, B1 );
function onInit() {
nrf.init([0,0,0,0,1], [0,0,0,0,2]);
}
onInit();
setInterval(function() {
nrf.slaveHandler();
}, 50);
Here I subtracted everything to SPI1 and, as an example, the names of the pins coincided. But then I don't understand what to do, I tried to output the command to the console from the spark of the LC mini, and on the spark of the LC connected to the power supply from the outlet, I planned to send a message from the example through the button:
nrf.sendCommand("1+2", function(r) { print("=="+r); });
the result should be =3
But this did not happen ... I tried the options from the example and also in the empty.
The code on Master was like this:
var knopa = require('@amperka/button').connect(P3);
SPI2.setup({sck:B13, miso:B14, mosi:B15});
var nrf = require("NRF24L01P").connect( SPI2, B0, B1 ); //B0(P6),B1(P5) насхемеискры
});
Please tell me what and where I did wrong? And then I got confused and I can't figure out where the error is myself. If it is possible with a detailed description, I am not strong in JS yet, while I am mastering.
Thank you in advance and apologize for the bedsheet.
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.
Hello, I have two IskraJS boards(http://wiki.amperka.ru/js:iskra_js – ISKRAJS on the Amperka website) and IskraJSmini(http://wiki.amperka.ru/продукты:iskra-js-mini – ISKGAJSMIN on the amperka website) and two NRF24l01+ wireless communication modules. I connected the modules to the boards directly using an auxiliary pinout scheme from the sites above and to the module itself to the available SPI interfaces (without IRQ contact):
MISO – MISO;
MOSI – MOSI;
SCK – SCK;
CSN – CSN;
CE- CE;
Vcc – 3.3V;
GND – GND.
I used the instructions from the website(http://www.espruino.com/NRF24L01P - description of the connection NRF24l01+ to work via EspruinoIDE), as I understood there was no IRQ connection required, well, I did not connect it…
In the code for the Iskra JS board, which became the emitter (Master), I prescribed again as from the example (only for the necessary contacts):
SPI2.setup({sck:B13, miso:B14, mosi:B15});
var nrf = require("NRF24L01P").connect( SPI2, B0, B1 ); //B0(P6),B1(P5) на схеме
function onInit() {
nrf.init([0,0,0,0,2], [0,0,0,0,1]);
}
onInit();
setInterval(function() {
nrf.masterHandler();
}, 50);
And I didn't do anything else – but it is filled into memory every other time (the console falls out when filling the firmware).
In the code for the Iskra JS mini board, which I have become a receiver (Slave), I prescribed and filled in (the console worked fine in the Espruino ide):
SPI1.setup({sck:A5, miso:A6, mosi:A7});
var nrf = require("NRF24L01P").connect( SPI1, B0, B1 );
function onInit() {
nrf.init([0,0,0,0,1], [0,0,0,0,2]);
}
onInit();
setInterval(function() {
nrf.slaveHandler();
}, 50);
Here I subtracted everything to SPI1 and, as an example, the names of the pins coincided. But then I don't understand what to do, I tried to output the command to the console from the spark of the LC mini, and on the spark of the LC connected to the power supply from the outlet, I planned to send a message from the example through the button:
nrf.sendCommand("1+2", function(r) { print("=="+r); });
the result should be =3
But this did not happen ... I tried the options from the example and also in the empty.
The code on Master was like this:
var knopa = require('@amperka/button').connect(P3);
SPI2.setup({sck:B13, miso:B14, mosi:B15});
var nrf = require("NRF24L01P").connect( SPI2, B0, B1 ); //B0(P6),B1(P5) насхемеискры
function onInit() {
nrf.init([0,0,0,0,2], [0,0,0,0,1]);}
onInit();
setInterval(function() {
nrf.masterHandler();
}, 50);
knopa.on('press', function() {
nrf.sendCommand("1+2", function(r) { print("=="+r);
});
});
Please tell me what and where I did wrong? And then I got confused and I can't figure out where the error is myself. If it is possible with a detailed description, I am not strong in JS yet, while I am mastering.
Thank you in advance and apologize for the bedsheet.
3 Attachments