Yes! You probably want to look at https://www.espruino.com/Reference#l_NRF_requestDevice
For instance there's an example there like this:
var gatt; NRF.requestDevice({ filters: [{ namePrefix: 'Puck.js' }] }).then(function(device) { return device.gatt.connect(); }).then(function(g) { gatt = g; return gatt.getPrimaryService("6e400001-b5a3-f393-e0a9-e50e24dcca9e"); }).then(function(service) { return service.getCharacteristic("6e400002-b5a3-f393-e0a9-e50e24dcca9e"); }).then(function(characteristic) { return characteristic.writeValue("LED1.set()\n"); }).then(function() { gatt.disconnect(); console.log("Done!"); });
Apart from the NRF bit in NRF.requestDevice, the API itself is based on "Web Bluetooth" so you can always Google that and look for examples.
NRF
NRF.requestDevice
@Gordon started
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.
Yes! You probably want to look at https://www.espruino.com/Reference#l_NRF_requestDevice
For instance there's an example there like this:
Apart from the
NRF
bit inNRF.requestDevice
, the API itself is based on "Web Bluetooth" so you can always Google that and look for examples.