openbci-archive / OpenBCI_NodeJS

Node.js SDK for the all OpenBCI Biosensor Boards
https://www.npmjs.com/package/openbci
137 stars 52 forks source link

Need to expose the scale factor value, dynamic for each channel #46

Open andrewjaykeller opened 8 years ago

andrewjaykeller commented 8 years ago

I am finding that it is useful to expose the current scale value to multiply the raw channel value with when sending data to cassandra.

teonbrooks commented 8 years ago

so you just want the results from the A-to-D conversion then?

andrewjaykeller commented 8 years ago

Well I'm only sending 24bits of data to Cassandra for each channel to minimize overhead and bandwidth, so I also must send once the value to multiple each 24 bit number by

teonbrooks commented 8 years ago

yeah, that is what i was talking about a while ago. didn't you suggest having a way to toggle data output. you could add a param when it starts up analog or digital and in the data packet for analog the scale = 1 and for digital, scale = scaleFactor.

andrewjaykeller commented 8 years ago

in a nutshell, there is more to it but yeah, we can now do other stuff with the stream packets to indicate to the computer-driver to do something different with it

teonbrooks commented 8 years ago

oh, you mean to keep the packet compatible for impedance test as well as data streaming? because the scaleFactor is static scalar

andrewjaykeller commented 8 years ago

yea, the four immediate cases are, and keep in mind this only really pertains to sending different types of data packets:

  1. 8 channels with 3 accel
  2. 8 channels but don't scale aux bytes
  3. User defined stream packet (you are doing on board DSP and want to send other info)
  4. Time Stamped packet accel (8 chan, 4bytes for time 2bytes for accel)
  5. Time Stamped packet aux (8 chan, 4bytes for time 2bytes for aux)