Features
Features
With p5.ble.js, you can -
- Request and connect to nearby Bluetooth devices,
- Read / write Bluetooth characteristics,
- Start / stop notifications.
More
More
The library is supported by code examples, tutorials that cover many popular Bluetooth LE devices. p5.ble.js is inspired by p5.serialport, p5.js, Web Bluetooth API, and Processing Serial Library.
Connect to a BLE device and read from one characteristic:
// Connect to a BLE device by passing the service UUID
p5ble.connect('19b10010-e8f2-537e-4f6c-d104768a1214', gotCharacteristics);
// Got Characteristics
function gotCharacteristics(error, characteristics) {
console.log(characteristics);
myCharacteristic = characteristics[0];
// Read the value of the first characteristic
p5ble.read(myCharacteristic, gotValue);
}
Examples and Tutorials
Examples and Tutorials
Checkout Out all the examples and tutorials!