Skip to content

Instantly share code, notes, and snippets.

@mrodem
mrodem / python-opencv
Created November 30, 2011 20:17
python-opencv-mrodem
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:
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',
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);
});
}
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)
'use strict';
const { AdapterFactory, ServiceFactory } = require('pc-ble-driver-js');
const adapterFactory = AdapterFactory.getInstance();
const serviceFactory = new ServiceFactory();
let heartRateService;
let heartRateMeasurementCharacteristic;