openbci-archive/OpenBCI_NodeJS

issue with board initialization

Closed this issue · 5 comments

var ourBoard = require('openbci-sdk').OpenBCIBoard({
...     verbose: true
... });

returns

TypeError: this.numberOfChannels is not a function
    at OpenBCIFactory.OpenBCIBoard (/Users/daniel.gulyas/dev/openbci-narcolepsy/node_modules/openbci-sdk/openBCIBoard.js:97:69)
    at repl:1:39
    at REPLServer.defaultEval (repl.js:262:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:431:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:211:10)
    at REPLServer.Interface._line (readline.js:550:8)

but

        var OpenBCIBoard = require('openbci-sdk');
        var ourBoard = new OpenBCIBoard.OpenBCIBoard();

works fine! any ideas why?

Which version are you using?
Is this error on initialization?

this was someone else's error, but I've run into this as well. they are using openbci-sdk 0.3.7 and node 4.4.6. Yes, the error is on init

i always use this form to initialize:

        var OpenBCIBoard = require('openbci-sdk');
        var ourBoard = new OpenBCIBoard.OpenBCIBoard();

ok will investigate! Thanks for the report! I guess all the automated tests are using the way you do too 👎

wow... epic fail on my part! The read me was wrong every where but a couple of them! Big thanks to "someone else" @andrewheusser Please checkout this PR and merge if it looks good! Thanks for the report and follow through. ~AJ