Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Digispark Arduino-compatible development board

Say hello to my little friend!

This is the Digispark: “The micro-sized, affordable, Arduino enabled, usb development board.” This board has 6 I/O lines, which doesn’t sound like much, until you consider that it supports I2C, which is a 2-wire serial bus capable of addressing many peripherals at once.

This is my first venture into Arduino-land, and I’m still climbing the learning curve. But I have many ideas for projects, and I’m sure that more will occur to me as I get deeper into the system. It’s been a long time since I got to play around with DIY electronics  but it’s something I used to enjoy a lot.

I haven’t had much time to play with them yet, just enough to try some of the example code, blinking the on-board status LED, and programming it to act as a keyboard or mouse. The main hurdle I’m trying to get over right now is to communicate with it over USB through nodejs. I found the node-hid module, and I’m able to see the Digispark and read its USB product info, but I haven’t been successful at actually reading/writing my own messages to it yet. Once I get past that, I will be able to send commands to it in real-time, which will be more interesting when I get it hooked up to some other sensors and devices.

Digispark: The micro-sized, affordable, Arduino enabled, usb development board!

Digispark: The micro-sized, affordable, Arduino enabled, usb development board!

Eventually, I’d like to get some remote communications modules (WiFi or Bluetooth), so that it can be a stand-alone device that I can interact with remotely. I should be able to build some simple robots, for example.

I hope to post more about it soon, assuming I can find time to make something interesting. If anybody else is playing with the Digispark and nodejs, I’d be particularly interested in hearing from you. Once I get some test code working, I’ll put it up on Github.

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Tech and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

3 Responses to Digispark Arduino-compatible development board

  1. Anonymous says:

    You’ve got some good ideas here. I will be interested in your progress. I fooling around with digispark too.
    http://mypetdigispark.blogspot.com/
    @barnacleBudd

  2. Ben Hardill says:

    Hi, Did you get anywhere with node-hid?

    I’ve been playing with the DigiRGB LED shield and I’m trying to drive it from node as well but also not getting anywhere when trying to write bytes to the device.

  3. Yes I did! Note that I had to modify the DigiUSB library files. The details about that modification are here:

    http://digistump.com/board/index.php/topic,944.msg3623.html

    I’ve put up a Gist with some sample code, both from the Digispark side and the nodejs side:

    https://gist.github.com/dougalcampbell/6512848

    Note, this code is very crude. I just threw it together based loosely on ecto’s duino code. Then I hacked the heck out of it trying to debug why things didn’t work. So there’s a lot of debug code hanging around in there.

    But, it should give you the idea. There are examples of both writing to and reading from USB. In fact, there are a couple of different methods for reading, because early on I had trouble with the HID.read() call, and tried going lower-level with HID.getFeatureReport(). Both should be working now.

    When I can find time, I’ll clean the code up, document some things, and put it all together in some nicer presentation.

Leave a Reply

%d bloggers like this: