hArduino

Control your Arduino board from Haskell

View the Project on GitHub LeventErkok/hArduino

hArduino

Build Status

hArduino allows Haskell programs to control Arduino boards and peripherals, using the Firmata protocol.

Important Note: The Firmata project has moved on since hArduino was released, and their latest protocol implementation does not work with hArduino. Please use the following (slightly older) copy for hArduino: Standard Firmata. See also instructions below.

On Hackage (v1.1): hArduino. (Released: March 27, 2016.)

Some example programs:

NB. Sample programs above use the device /dev/cu.usbmodemfd131 to access the Arduino, which happens to be the port I use on my development Mac machine. Make sure you use the correct port name in the call to the withArduino function, pointing to the USB port your Arduino is connected to. (On Linux, this will look like one of /dev/ttyUSB*, /dev/ttyACM* or similar. On Windows, it will look something like COM3.)

There is a short video (4m29s) demonstrating the blink example.

hArduino has been tested on Mac OSX (Mountain Lion), Linux (Ubuntu 12.04.2), and Windows 7. Patches, bug reports, and suggestions are most welcome.

Release notes.

Arduino setup

NB. Unfortunately hArduino does not work with latest releases of the firmata protocol as it is maintained by the Arduino community. This is not unexpected: Firmata moves on, but there isn't enough resources to keep all the clients up-to-date with the latest versions. To use hArduino, you need to make sure your Arduino board is connected to your computer, and a custom version of the firmata protocol is running on it:

Note that you need to do these steps only once. Once you get StandardFirmata running on your board, it will stay there even if you disconnect your Arduino from the USB port, or completely power down your computer.

Thanks

The following people reported bugs, provided comments/feedback, or contributed to the development of hArduino in various ways: Can Ak├žura, Alexander Altman, Andriy Drozdyuk, and Antoine Dumont. Also, thanks to David Palmer for lending me his OSEPP LCD shield to play with!