To return any device advertising the Nordic UART service.
What you're doing with Serial1.* is you're using the physical UART on the Puck on pins D28/29 - that's nothing to do with Bluetooth. What you need is https://www.espruino.com/BLE+UART
So your code would be more like:
// Function to send a message
function sendMessage(message) {
NRF.connect("ff:8d:05:ae:17:64 random").then(function(d) {
device = d;
console.log("Device ",device);
require("ble_simple_uart").write(device, message, function() {
print('Done!');
});
});
}
// Send a message when the button is pressed
setWatch(function() {
sendMessage("Hello, Arduino!");
}, BTN, { edge: "rising", debounce: 50, repeat: true });
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.
Ahh - ok. Right, well, first off to detect the feather, using MAC address is great if it's just one-off. You can see it reports as:
So you can do:
To return any device advertising the Nordic UART service.
What you're doing with
Serial1.*
is you're using the physical UART on the Puck on pins D28/29 - that's nothing to do with Bluetooth. What you need is https://www.espruino.com/BLE+UARTSo your code would be more like: