Closed nmelin closed 10 years ago
It could be possible using a custom Firmata implementation, however that would mean the only component you could use with johnny-five while running such firmware would be the PulseSensor. The reason is that the pulse sensor requires precise timing and therefore uses hardware interrupts which are not accessible through StandardFirmata (the firmware/sketch typically run on an Arduino when using johnny-five or other Firmata clients).
I have a simple proof of concept using a custom Firmata sketch that you could try. The corresponding JavaScript code is not for johnny-five but you could port it to J5's architecture.
The Arduino files are here: https://github.com/soundanalogous/breakout-experiments/tree/master/pulse_sensor/sketch/PulseSensorAmped_Firmata
And you'll find a js file here (again not for J5 so you'll have to change it to use the node-firmata / johnny-five architecture): https://github.com/soundanalogous/breakout-experiments/blob/master/pulse_sensor/PulseSensor.js Basically you access the raw sysex message data.
There is a Firmata plug-in architecture in the works as well (configurable firmata) that will make it possible to mix in custom functionality with standard functionality (analog and digital i/o, etc). But that is still a work in progress.
Thanks Jeff!
Hey,
Could you guys have a look at a similar problem that I'm having?
Hello, doing a bit of pre-emptive project research.
has support for this been implemented: PulseSensor Heart-Rate BPM for Arduino http://pulsesensor.myshopify.com/pages/code-and-guide
If not, do you think this would be implemented with a 'new five.Sensor()' function ?