Earlier in this article series I showed how to install NodeJS – it was pretty simple with an install script. However, I thought I better show how I actually worked with NodeJS to create my little 1b1 driver code.
Again, simple, I used others hard work. Specifically, Michael Hord with Sparkfun’s MiniMoto library.
There’s a lot left to do, but it works.
Have the constructor accept an options object
Add read() to get the current speed which a motor is set.
Refactor option to clear faults on write to be determined during construction
Add acceleration and deceleration algorithms add functions.
Create an async polling of fault codes.
But! For now it works.
Also, or those who are like, “You stole code, dewd! Not cool.” Mhord’s code has a beerware license. I sent this email to Sparkfun in regards to the license and how I might pay Sparkfun back for their work.
Hey Mr. Hord,
I’m in the process of porting your DRV8830 library to Node–I wanted to make sure I give appropriate credit.
Also, was going to ship some beer to Sparkfun–in respect of the beerware license. Just let me know what kind.
Lastly, I wanted to make sure Sparkfun benefits. It looks like the DRV8830 TinyMoto board has been discontinued. > Should I recommend people roll their own…or gasp get something off a slow ship from China?