Hello all,
I'd like to present
Elmduino, a starter kit for programming Arduino-based robots in Elm. There are multiple components but none of them are difficult. Signal flow it bidirectional (robot <-> Elm), and uses the ports API. I used
socket.io to transmit events to a node.js server, and glued them to Johnny-Five, a node module for arduino programming. I have not tried to put this on the public library because it uses ports and non-Elm code. Robots have been discussed on this forum before, but to my knowledge this is the first time anyone has actually done it.
The robot I used is courtesy of the Tufts Robotics Club. Videos can be found
here. The first video shows a simple program, and the second shows arrow key controls implemented during a Fun in the Afternoon session. Currently the node server declares what IO the robot has, and does not pass some of the control abstractions up to Elm. I was advised to try to make the JS as general as possible, so a completely different robot could be programmed by only changing Elm code. I think the functional programmer would appreciate this, but the Arduino robot enthusiast is a hacker, and doesn't want part of the stack to be opaque. I'd appreciate feedback on this point (in particular).
Currently the robot must be controlled via tether. WiFi and Bluetooth may provide short-term wireless control. One day Elm may compile down to Node, in which case the Raspberry Pi would be promising (especially with
Lego NXT GPIO). Long term, we may be able to target Arduino code directly.
So yeah, this is a thing now.
Max