This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import opencv | |
#this is important for capturing/displaying images | |
from opencv import highgui | |
import pygame | |
import sys | |
video = highgui.cvCreateFileCapture("/home/magrode/out.avi") | |
def get_image(): | |
im = highgui.cvQueryFrame(video) | |
if im == None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PythonShell = require('python-shell'); | |
// Assumes that pc-nrfutil exists in $CWD/python/pc-nrfutil | |
const options = { | |
mode: 'text', | |
cwd: `${__dirname}/python/pc-nrfutil`, | |
args: [ | |
'-v', | |
'dfu', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const zerorpc = require("zerorpc"); | |
const AdapterFactory = require('pc-ble-driver-js').AdapterFactory; | |
const server = new zerorpc.Server({ | |
getAdapters: function (reply) { | |
const factory = AdapterFactory.getInstance(); | |
factory.getAdapters((error, adapters) => { | |
reply(error, adapters); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zerorpc | |
c = zerorpc.Client() | |
c.connect("tcp://127.0.0.1:4242") | |
adapters = c.getAdapters() | |
for serial_number, adapter in adapters.items(): | |
print(serial_number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { AdapterFactory, ServiceFactory } = require('pc-ble-driver-js'); | |
const adapterFactory = AdapterFactory.getInstance(); | |
const serviceFactory = new ServiceFactory(); | |
let heartRateService; | |
let heartRateMeasurementCharacteristic; |