-
Notifications
You must be signed in to change notification settings - Fork 9
APIs for Robots
Alan Languirand - @13protons
[FirstName LastName (@twitter)], …
Robots are in the physical space. They read voltages from sensors and turn them into data. Things are sampled via analog interfaces and output over serial ports.
We write code to go into the cloud and show up on web interfaces, design apis and work with non-linear systems.
How to make these two worlds talk to one another?
I've had some experience with arduino and piecing together a complex (feeling) stack that:
- takes a gps, reads the data over analog pins
- runs it through a processing library in C
- sends it to the arduino's serial port
- which uses an xbee as a wireless serial bridge to my laptop
- using node.js and a serial port monitor package to intercept the data and then
- finally - log it in a remote database through a web api.
I had a hunch that there could be a better way. Arduino is awesome for reading sensor data and getting to a serial port, but the Rasberry PI (http://www.raspberrypi.org/) is a fully capable linux computer for $25 that has analog I/O pins. You can run node on it to write in JS (or run python or many other languages), and cut out the complicated steps of parsing serial messages and let your code talk directly to both your sensors & the internet.
Buy a pi, make robots. Simple, right? Obviously there is much more to physical computing, but this one device will bring API libraries and physical sensors/actuators right into contact with one another and get the robot of your dreams going faster.