evantahler / nodePhidgets

Node.js JavaScript library to interface with the Phidgets line of hardware boards.
Other
30 stars 8 forks source link

Allowing for multiple board models in the library #7

Closed djipco closed 9 years ago

djipco commented 9 years ago

It would be nice if the phidgets object actually became the top-level module inside which various phidget board models could be created. This would make it easy for the community (including myself) to gradually add other boards to the library.

It would be very simple to set up but would mean a change in the architecture (and an update to the documentation) so that you could do this:

var phidgets = require('phidgets');
var pik = new phidgets.PhidgetInterfaceKit();
var pled = new phidgets.PhidgetLED();
var pgps = new phidgets.PhidgetGPS();
// etc.

The idea would be to have a top Phidget abstract object (inheriting from EventEmitter) from which all board objects would be created. Does that make sense ? I might be willing to take a stab at it.

evantahler commented 9 years ago

Go for it!
I don't work with this project much any more, so if you are willing to undertake the work the work for that change, I'll make you a co-owner of this project (here on github and NPM)

djipco commented 9 years ago

That would be great! As part of a college course I'm teaching, I'm investigating the opportunities offered by web technologies in the field of physical computing. The Phidgets are a piece of a toolkit I'm building for my students. I don't know how much time I can dedicated to this but this first architectural change is rather simple to implement and will at least open up the door to more additions by the community. Thanks!