Socket
Socket
Sign inDemoInstall

bbc-microbit

Package Overview
Dependencies
23
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

examples/compass.js

36

API.md

@@ -11,3 +11,4 @@ # node-bbc-microbit API

1. [Temperature](#temperature)
1. [UART](#uart)
1. [UART](#uart)
1. [Event](#event-5)

@@ -372,1 +373,34 @@ ## Require module

```
## [Event](https://lancaster-university.github.io/microbit-docs/ble/event-service/)
### Micro:bit Events
Events come in two varieties, reflected by the two corresponding characteristics:
Micro:bit Events emanate from the micro:bit and may be notified to the connected client.
Client Events emanate from the connected client and may be written to the connected micro:bit
### Write event
```javascript
microbit.writeEvent(id, value, callback);
```
### Subscription
```javascript
microbit.subscribeEvents(id, value, callback(error));
microbit.unsubscribeEvent(callback(error));
```
#### Event
```javascript
microbit.on('event', function(id, value) {
// ...
});
```

@@ -12,2 +12,4 @@ /*

*
* http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html for hex files and micro:bit info
*
*/

@@ -14,0 +16,0 @@

@@ -12,2 +12,4 @@ /*

*
* http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html for hex files and micro:bit info
*
*/

@@ -14,0 +16,0 @@

@@ -12,2 +12,3 @@ /*

*
* http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html for hex files and micro:bit info
*/

@@ -14,0 +15,0 @@

4

lib/bbc-microbit.js

@@ -10,2 +10,3 @@ var NobleDevice = require('noble-device');

var UartService = require('./uart-service');
var EventService = require('./event-service');

@@ -34,2 +35,3 @@ function BBCMicrobit() {

NobleDevice.Util.mixin(BBCMicrobit, UartService);
NobleDevice.Util.mixin(BBCMicrobit, EventService);

@@ -46,3 +48,3 @@ BBCMicrobit.prototype.toString = function() {

if (error) {
return callback();
return callback(error);
}

@@ -49,0 +51,0 @@

{
"name": "bbc-microbit",
"version": "0.1.0",
"version": "0.2.0",
"description": "Control a BBC micro:bit from Node.js using BLE ",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,3 +8,3 @@ # node-bbc-microbit

* See [noble prerequisites](https://github.com/sandeepmistry/noble).
* Requires a custom firmware build on the micro:bit. This build removes pairing security and enables all BLE services.
* Requires a custom firmware build on the micro:bit. This build removes pairing security and enables all BLE services. The source code of the custom firmware can be found [here](https://github.com/sandeepmistry/node-bbc-microbit-firmware).

@@ -11,0 +11,0 @@ ### Flashing micro:bit firmware

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc