Jump to content

github project Bonejs

Recommended Posts

Mentioned here: http://forum.43oh.com/topic/9644-nodejs-gpio/?p=73277 but I figure this really needs it's own post in the projects section here. The code is extremely simple, minimal / too the point. There is not a whole lot of error detection, but probably sufficient in most cases. There was some stuff intentionally left out. Such as I2C writes. I have my reasons, which should be obvious. But a write feature for I2C would be extremely easy to implement. Especially given that provided code gives a very clear idea of how that can be done.



Link to post
Share on other sites

Updated, and added more files to the project. I added a wrapper for universal-io's config-pin utility. https://github.com/cdsteinkuehler/beaglebone-universal-io


My reasoning here is simple. I plan on writing a web app that allows the user to configure their pins from within a browser. universal-io, and config-pin should work perfectly towards that end goal.




And of course, I'm not sure how soon I'll get the above done. I do have other higher priority things going on in my life right now too. So I'll probably just tinker around with it now and again . . .

Link to post
Share on other sites
  • 1 month later...

I added wrapper code for devmem2.c, and wrote an example that twiddles the USR LED bits so that the blink pattern resembles "Cylon eye movement". e.g. the blink pattern goes back and forth form one side to the next, while pausing slightly longer on the outside LEDs.


Personally, I think this is pretty cool, but I'm still "on the fence" on how useful this really is. Since Nodejs is interpreted javascript, it should theoretically use more CPU than a natively compiled binary. However, the Cylon example I wrote only uses 5-6% CPU, which I think for Nodejs is not too shabby. At  minimum though. This could serve as an example of how to twiddle GPIO registers on the Beaglebone black, while in Linux, but "going behind Linuxes back" ;) Which just means one should take care when using this method that an Linux application that uses the GPIO's how they're meant to be used form userspace. Does not conflict with this approach.


Anyway, I need to write documentation for this, and make sure I'm allowed to upload a modified version of devmem2.c ( to take out the unnecessary printf()'s ). Then I should be able to commit this addition.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...