🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

cytonjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

cytonjs

Optimal browser streaming tool for the Cyton & Daisy Cyton by OpenBCI

unpublished
latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

cyton.js

This tool lets you handle OpenBCI Cyton data streams in the browser via USB.

npm i cytonjs
let cyton = new cyton(
    onDecodedCallback(newLinesInt),
    onConnectedCallback,
    onDisconnectedCallback,
    mode
    CustomDecoder,
    baudrate,
); 

//create an OpenBCI Cyton streaming device. Specify 'daisy' mode for the 16 channel stream configuration. Can specify baudrate.

// customize the onDecodedCallback, which returns a count for the number of new lines

cyton.getLatestData(channel,count) 

// get the latest chunk of data for a selected channel, use this with the 
// onDecodedCallback to continuously pull the new data,
// which does not show up in uniform chunks to prevent issues around periodic browser 
// slowdowns in high demand applications.

cyton.setupSerialAsync(baudrate); 
//this runs the USB connect command, it will pop up a browser menu.

cyton.closePort(); //disconnect


The decoder runs at a throttled rate which you can change in the code as this.readRate.

This keeps it from eating up browser time as the device streams at 250sps and will lock everything up otherwise. Generally, setting this to a minimum framerate is best for actual applications (e.g. 60fps).

The decoder uses something called a boyerMoore search so as data comes in and builds the buffer up, the search will identify each line of code by special identifier bytes which the decoder then chunks through to build the dataset.

Timestamps assume zero dropped samples and are incremented linearly, no issues so far there so sample pacing is kept perfect and timed by when the first line of data comes in.

By: Joshua Brewster License: AGPL v3.0

Keywords

openbci

FAQs

Package last updated on 09 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts