So we’ve been sort of on a roll with Dynamo since the holiday break. A few solid new developments this week, which is not bad considering none of us code Dynamo as our day job and we tend to hack on these things at night. A few blog posts need to be written about them.
One of the requests recently has been for enhanced Arduino functionality. If you don’t know, Arduino is a sweet little microprocessor to which you can connect sensors, lights and motors. You can use it to control physical devices from a computer or control a computer from a physical device. Pretty slick and becoming quite popular. Easy to program though a Processing-derived IDE and language. And now Dynamo can have a two way dialog with Arduino.
In the video below I’m controlling a parametric model with a physical slider, or variable potentiometer.
There has been an Arduino node in Dynamo for a while but it was a tad finicky. Now we have better ways to control this. Basic idea is there is an Arduino node responsible for setting up the COM serial connection. There is a Timer / Evaluation node that ‘ticks’ every n number of milliseconds, then there are Arduino Read and Arduino Write nodes. Both of these deal with strings. The Read node reads a whole text line coming ‘down the line’ from the Arduino sketch, it dumps out a string that you can parse with other string nodes. The Write Node pushes whatever data back ‘up the line’ to the serial port and the listening Arduino Sketch.
This code is not in the downloadable installer just yet, but is in the development branch on github, and if you ask nicely we can get you a preview build.
The ardiuno write node outputs strings now and this allows more flexibility with parsing the results. Here we see the output from a temperature and a relative humidity sensor, split into different inputs and turned into numbers using the String to Number node.
Like Ma Bell, we’ve got the ill communications.
-matt