Skip to content
Discussion options

You must be logged in to vote

Where did you get the code from? I guess an AI wrote that for you?

If you look at https://www.espruino.com/Reference#l_NRF_setScan it's not how you use setScan.

Probably all you want is:

NRF.setScan(function(device) {
  console.log(device.id);
  console.log(device.rssi);
});

Depending what you're after you might want NRF.requestDevice (find one device) or NRF.findDevices (scan for X seconds and return what was found). setScan will call you back every time an advertisement is received, which could be a lot!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@markjlascelles
Comment options

Answer selected by markjlascelles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants