Numato Lab 32 Channel USB Gpio NodeJS Module

Having played with the Raspberry PI GPIO interface for over a year, I thought I should explore options for a faster CPU/RAM and a different architecture to enable quicker device control and more complex software. The fastest option for controlling is using a standard PC and a standard CPU architecture.

After some research, I found this USB controlled GPIO module from Numato Lab:

It connects to your PC using a standard USB cable, and reveals itself as a serial device which routes GPIO commands between your application and pins. After research on how to use it with NodeJS I found Numato’s sample – it relies on the “serial” NodeJS module, which sends asynchronous commands to a serial port, resulting in a callback nightmare.

Below is code written to allow synchronous use of this device, with NodeJS and Linux:

This enables a clear command flow to and from the device.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.